Browse Source

delete generate dic from type,fixed type error

master
jkpete 1 month ago
parent
commit
19a4291395
  1. 2
      addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotSaveTable.cs
  2. 2
      addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotTable.cs
  3. 15
      addons/EGFramework/Module/GenerateTools/Templete/Variant/EGVariantGenerator.cs

2
addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotSaveTable.cs

@ -31,7 +31,7 @@ namespace EGFramework.UI @@ -31,7 +31,7 @@ namespace EGFramework.UI
}
this.Vertical = true;
CurrentDataKey = key;
EmptyData = typeof(T).EGenerateEmptyDictiontaryByType();
EmptyData = new T().EGenerateDictiontaryByObject();
QueryPage.Register(() => QueryPageData<T>());
SearchKey.Register(() => SearchDataByKeyword<T>());
TableName = typeof(T).Name;

2
addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotTable.cs

@ -56,7 +56,7 @@ namespace EGFramework.UI @@ -56,7 +56,7 @@ namespace EGFramework.UI
PageAdapter.Reload(count, PageLimit);
}
this.Vertical = true;
EmptyData = typeof(T).EGenerateEmptyDictiontaryByType();
EmptyData = new T().EGenerateDictiontaryByObject();
TitleData = typeof(T).EGenerateDictiontaryByType();
TableName = typeof(T).Name;
InitFunctionMenu();

15
addons/EGFramework/Module/GenerateTools/Templete/Variant/EGVariantGenerator.cs

@ -21,21 +21,6 @@ namespace EGFramework{ @@ -21,21 +21,6 @@ namespace EGFramework{
}
return result;
}
public static Dictionary<string, object> EGenerateEmptyDictiontaryByType(this Type self)
{
PropertyInfo[] propertyNames = self.GetProperties();
FieldInfo[] fieldNames = self.GetFields();
Dictionary<string, object> result = new Dictionary<string, object>();
foreach (PropertyInfo pName in propertyNames)
{
result.Add(pName.Name, "");
}
foreach (FieldInfo fName in fieldNames)
{
result.Add(fName.Name, "");
}
return result;
}
public static Dictionary<string, Type> EGenerateTypeDictiontaryByType(this Type self)
{
PropertyInfo[] propertyNames = self.GetProperties();

Loading…
Cancel
Save