private void Build(Framework.Parts.IActor actor) { displayProperties = new Utility.PropertyTable(); Proteus.Framework.Parts.IProperty[] properties = currentActor.Properties; foreach (Proteus.Framework.Parts.IProperty p in properties) { // Now set it. TypeConverter converter = TypeDescriptor.GetConverter( p.Type ); Type editorType = p.EditorType; Utility.PropertySpec spec = null; if (converter != null && editorType != null) { spec = new Utility.PropertySpec(p.Name, p.Type, p.Category, p.Description, p.DefaultValue,editorType,converter.GetType() ); } else { spec = new Utility.PropertySpec(p.Name, p.Type, p.Category, p.Description, p.DefaultValue); } // Store it. displayProperties.Properties.Add( spec ); displayProperties[ p.Name ] = p.CurrentValue; } propertyGrid1.SelectedObject = displayProperties; displayProperties.SetValue += new Proteus.Editor.Utility.PropertySpecEventHandler(displayProperties_SetValue); }
private void Build(Framework.Parts.IActor actor) { displayProperties = new Utility.PropertyTable(); Proteus.Framework.Parts.IProperty[] properties = currentActor.Properties; foreach (Proteus.Framework.Parts.IProperty p in properties) { // Now set it. TypeConverter converter = TypeDescriptor.GetConverter(p.Type); Type editorType = p.EditorType; Utility.PropertySpec spec = null; if (converter != null && editorType != null) { spec = new Utility.PropertySpec(p.Name, p.Type, p.Category, p.Description, p.DefaultValue, editorType, converter.GetType()); } else { spec = new Utility.PropertySpec(p.Name, p.Type, p.Category, p.Description, p.DefaultValue); } // Store it. displayProperties.Properties.Add(spec); displayProperties[p.Name] = p.CurrentValue; } propertyGrid1.SelectedObject = displayProperties; displayProperties.SetValue += new Proteus.Editor.Utility.PropertySpecEventHandler(displayProperties_SetValue); }