void SelectType(JsonObjectHelperTypes typeName) { mCurTypeName = typeName; //重新搜索// DoSearch(m_strFilter); onSelectFile(-1); }
public static void SaveHelperConfiguration(JsonObjectUIHelper helper) { JsonObjectHelperTypes type = ((JsonObjectTypeAttribute)helper.GetType().GetCustomAttributes(typeof(JsonObjectTypeAttribute), false)[0]).Type; Dictionary <string, string> dic = new Dictionary <string, string>(); helper.OnSaveConfig(dic); System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (KeyValuePair <string, string> i in dic) { sb.Append(string.Format("{0}|{1}\n", i.Key, i.Value)); } EditorPrefs.SetString(string.Format("{0}{1}", ConfStringInterfaceHelperPrefix, type.ToString().ToUpper()), sb.ToString()); }
void LoadSelectedFiles(JsonObjectHelperTypes type, JsonObjectUIHelper helper, string conf) { HashSet <string> files = new HashSet <string>(); string[] f = conf.Split('|'); foreach (string i in f) { if (string.IsNullOrEmpty(i)) { continue; } files.Add(i); } mHelperSelectedFiles[type] = files; }
public static void PerformAll(JsonObjectHelperTypes type, List <string> errors) { JsonObjectUIHelper helper; if (mUIHelperMap.TryGetValue(type, out helper)) { string[] files = System.IO.Directory.GetFiles(helper.GetSearchDir(), "*" + helper.GetFileExt(), System.IO.SearchOption.AllDirectories); string error; foreach (string i in files) { if (!helper.MultipleAction(i, out error)) { errors.Add(error); } } } }
public JsonObjectTypeAttribute(JsonObjectHelperTypes type) { this.type = type; }