void PopulateEdit(PListDictionary dic) { ResetEntry(); _name = dic.StringValue(DISPLAY_NAME_KEY); _setting = dic.StringValue(SETTING_KEY); _isValidSettingName = ValidateSettingString(_setting); _groupIndex = System.Array.IndexOf(_groups, dic.StringValue(GROUP_KEY)); if (_groupIndex < 0) { _groupIndex = 0; } _entryType = (SettingType)System.Enum.Parse(typeof(SettingType), dic.StringValue(TYPE_KEY)); switch (_entryType) { case SettingType.Bool: _boolDefaultValue = dic.BoolValue(VALUE_KEY); break; case SettingType.Enum: var valDic = dic.DictionaryValue(VALUE_KEY); if (valDic != null) { foreach (var key in valDic.Keys) { _enumValues[key] = valDic.StringValue(key); } } var defaultIndex = dic.IntValue(DEFAULT_INDEX); _defaultEnum = _enumValues.Keys.ToList()[defaultIndex]; break; case SettingType.String: _stringDefaultValue = dic.StringValue(VALUE_KEY); _isPath = dic.BoolValue(PATH_KEY); break; case SettingType.Array: case SettingType.StringList: _isInherit = dic.BoolValue(INHERIT_KEY); _isPath = dic.BoolValue(PATH_KEY); break; default: break; } }
public StaticLibraryEntry(PListDictionary dic) : base(dic) { var lm = dic.StringValue(LINK_TYPE_KEY); Link = (LinkType)System.Enum.Parse(typeof(LinkType), lm); }
public BoolBuildSettingEntry(PListDictionary dic) : base(dic) { string s = dic.StringValue(VALUE_KEY); Value = (s == XcodeBool.YES); }
public FrameworkEntry(PListDictionary dic) : base(dic) { var lm = dic.StringValue(LINK_TYPE_KEY); Link = (LinkType)System.Enum.Parse(typeof(LinkType), lm); Embedded = dic.BoolValue(EMBEDDED_KEY); }
public ScriptEntry(PListDictionary dic) { if (dic == null) { throw new System.ArgumentNullException(nameof(dic), "Dictionary cannot be null"); } Name = dic.StringValue(NAME_KEY); Shell = dic.StringValue(SHELL_KEY); if (string.IsNullOrEmpty(Shell)) { Shell = DEFAULT_SHELL; } Script = dic.StringValue(SCRIPT_KEY); }
public EnumBuildSettingEntry(PListDictionary dic) : base(dic) { GetBuildSetting(); var value = dic.StringValue(VALUE_KEY); ValidateAndSetValue(value); }
protected BaseFileEntry(PListDictionary dic) { if (dic == null) { throw new System.ArgumentNullException((dic).ToString(), "Dictionary cannot be null"); } Path = dic.StringValue(PATH_KEY); if (string.IsNullOrEmpty(Path)) { throw new System.ArgumentException("No Path entry in dictionary"); } var am = dic.StringValue(ADD_METHOD_KEY); Add = (AddMethod)System.Enum.Parse(typeof(AddMethod), am); SetFileName(); }
public SystemFrameworkEntry(PListDictionary dic) { FileName = dic.StringValue(NAME_KEY); //Fallback to old key name if (string.IsNullOrEmpty(FileName)) { FileName = dic.StringValue(OLD_PATH_KEY); } if (string.IsNullOrEmpty(FileName)) { throw new System.ArgumentException("No File name entry in dictionary"); } var lm = dic.StringValue(LINK_TYPE_KEY); Link = (LinkType)System.Enum.Parse(typeof(LinkType), lm); }
void DrawStringEntry(PListDictionary dic) { string val = dic.StringValue(VALUE_KEY); if (dic.BoolValue(PATH_KEY)) { if (!string.IsNullOrEmpty(val)) { val += " : "; } val += "Path"; } EditorGUILayout.LabelField(val, GUILayout.MaxWidth(600)); }
public StringBuildSettingEntry(PListDictionary dic) : base(dic) { Value = dic.StringValue(VALUE_KEY); }
EntryAction DrawEntry(PListDictionary dic, int index) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(dic.StringValue(DISPLAY_NAME_KEY), GUILayout.MaxWidth(400)); EditorGUILayout.LabelField(dic.StringValue(SETTING_KEY), GUILayout.MaxWidth(400)); var type = (SettingType)System.Enum.Parse(typeof(SettingType), dic.StringValue(TYPE_KEY)); EditorGUILayout.LabelField(type.ToString(), GUILayout.MaxWidth(200)); switch (type) { case SettingType.Bool: DrawBoolEntry(dic); break; case SettingType.String: DrawStringEntry(dic); break; case SettingType.Enum: DrawEnumEntry(dic); break; case SettingType.Array: case SettingType.StringList: DrawArrayEntry(dic); break; default: EditorGUILayout.LabelField("UNKNOWN", GUILayout.MaxWidth(600)); break; } EditorGUILayout.Space(); EditorGUILayout.LabelField(index.ToString(), GUILayout.MaxWidth(40)); EntryAction action = EntryAction.None; if (GUILayout.Button("^", GUILayout.MaxWidth(40))) { action = EntryAction.MoveUp; } if (GUILayout.Button("v", GUILayout.MaxWidth(40))) { action = EntryAction.MoveDown; } if (GUILayout.Button("e", GUILayout.MaxWidth(40))) { action = EntryAction.Edit; } if (GUILayout.Button("-", GUILayout.MaxWidth(40))) { if (EditorUtility.DisplayDialog("Remove Entry?", "Remove entry: " + dic.StringValue(DISPLAY_NAME_KEY) + " - " + dic.StringValue(SETTING_KEY), "Remove", "Cancel")) { action = EntryAction.Remove; } } EditorGUILayout.EndHorizontal(); return(action); }