public static UITypeEditor GetEditor(IToolBoxProperty property) { if (property.Name == "Alpha" || property.Name == "BorderAlpha" || property.Name == "BackgroudAlpha") { return new AlphaEditor(property); } else if (property.Name == "BackgroudImage") { return new ImageEditor(property); } else if (property.Name == PropertyUtility.DYNAMICNAME && property.ComponentType == typeof(FlashProperty)) { return new FlashEditor(property); } else if (property.Name == "Size") { return new SizeEditor(property); } else if (property.ValueType == PropertyValueType.enumtype) { return new EnumEditor(property); } else if (property.ValueType == PropertyValueType.color) { return new ColorEditor(property); } else if (property.Name == "Location" || property.Name == "ZIndex" || property.Name == "Id") { return new UITypeEditor(); } else { return new DataEditor(property); } }
private TypeConverter GetPropertyConverter(IToolBoxProperty property) { switch (property.ValueType) { case PropertyValueType.boolean: return new BooleanConverter(); case PropertyValueType.number: return new DoubleConverter(); case PropertyValueType.xml: case PropertyValueType.url: case PropertyValueType.str: return new StringConverter(); case PropertyValueType.color: return new ColorConverter(); case PropertyValueType.point: var convert = new PointConvert(); convert.Property = property; return convert; default: return null; } }
public ImageEditor(IToolBoxProperty property) : base() { Property = property; }
public AlphaEditor(IToolBoxProperty property) : base() { Property = property; }
protected virtual PropertyDescriptor CreateProperty(IToolBoxProperty binding) { var attrs = CreateAttributes(binding.Category, binding.Description, binding.Visible, binding.Description, binding.ReadOnly); var newAttrs = new Attribute[attrs.Length + 1]; attrs.CopyTo(newAttrs, 0); newAttrs[newAttrs.Length - 1] = new TypeConverterAttribute(typeof(PropertyConvert)); var descriptor = new ToolBoxPropertyDescriptor(binding, binding.Name, newAttrs); return descriptor; }
public ToolBoxPropertyDescriptor(IToolBoxProperty property, string name, Attribute[] attrs) : base(name, attrs) { Property = property; }
public ColorEditor(IToolBoxProperty property) : base() { Property = property; }
public EnumEditor(IToolBoxProperty property) : base() { Property = property; }
public FlashEditor(IToolBoxProperty property) : base() { Property = property; }