protected override void RefreshData() { // because RefreshData() called in base class constructor if (_Item == null) { _Item = (ClassPropertyDataListItem)Object; } _ClassNameField.Options.Clear(); _ClassNameField.Options.Add(new Skill.Editor.UI.PopupOption(0, "Unknown")); string[] classNames = _Item.Editor.GetClassNames(); for (int i = 0; i < classNames.Length; i++) { _ClassNameField.Options.Add(new Skill.Editor.UI.PopupOption(i + 1, classNames[i])); } int value = 0; for (int i = 1; i < _ClassNameField.Options.Count; i++) { if (_ClassNameField.Options[i].Content.text == ((ClassPropertyData)_Item.Data).ClassName) { value = _ClassNameField.Options[i].Value; break; } } _ClassNameField.SelectedValue = value; if (value == 0) { ((ClassPropertyData)_Item.Data).ClassName = "Unknown"; } base.RefreshData(); }
public void AddClassProperty() { ClassPropertyData cd = new ClassPropertyData(); cd.Name = "NewValue"; cd.ClassName = "Unknow"; var property = new ClassPropertyDataListItem(Editor, cd); _Properties.Add(property); RebuildProperties(); }
private void LoadProperties() { _Properties = new List <PropertyDataListItem>(); if (Data.Properties == null) { Data.Properties = new PropertyData[0]; } for (int i = 0; i < Data.Properties.Length; i++) { PropertyDataListItem property = null; if (Data.Properties[i].Type == PropertyType.Primitive) { property = new PrimitivePropertyDataListItem(Editor, (PrimitivePropertyData)Data.Properties[i]); } else { property = new ClassPropertyDataListItem(Editor, (ClassPropertyData)Data.Properties[i]); } _Properties.Add(property); } }
public ClassProperties(ClassPropertyDataListItem item) : base(item) { this._Item = item; }