protected override PropertyCollection OnCreatePropertyCollection() { IEnumerable <Property> props = new Property[] { new DoubleProperty(PropertyNames.Scale, 1, 0.2, 10), new Int32Property(PropertyNames.LineWidth, 2, 1, 10), StaticListChoiceProperty.CreateForEnum <Pattern>(PropertyNames.Pattern, 0, false), new BooleanProperty(PropertyNames.Transparent, true), new Int32Property(PropertyNames.LineColor, ColorBgra.ToOpaqueInt32(EnvironmentParameters.PrimaryColor.NewAlpha(byte.MaxValue)), 0, 0xffffff), new DoubleVectorProperty(PropertyNames.Offset, Pair.Create(0.0, 0.0), Pair.Create(-1.0, -1.0), Pair.Create(+1.0, +1.0)) }; IEnumerable <PropertyCollectionRule> propRules = new PropertyCollectionRule[] { new ReadOnlyBoundToBooleanRule(PropertyNames.LineColor, PropertyNames.Transparent, false) }; return(new PropertyCollection(props, propRules)); }
protected override PropertyCollection OnCreatePropertyCollection() { Size selection = EnvironmentParameters.SelectionBounds.Size; int radiusMax = Math.Min(selection.Width, selection.Height) / 2; int radiusDefault = radiusMax / 2; IEnumerable <Property> props = new Property[] { new Int32Property(PropertyNames.Radius, radiusDefault, 1, radiusMax), new BooleanProperty(PropertyNames.AntiAliasing, true), new Int32Property(PropertyNames.Margin, 0, 0, radiusMax), new BooleanProperty(PropertyNames.TransparentBack, true), new Int32Property(PropertyNames.BackColor, ColorBgra.ToOpaqueInt32(EnvironmentParameters.PrimaryColor.NewAlpha(byte.MaxValue)), 0, 0xffffff) }; IEnumerable <PropertyCollectionRule> propRules = new PropertyCollectionRule[] { new ReadOnlyBoundToBooleanRule(PropertyNames.BackColor, PropertyNames.TransparentBack, false) }; return(new PropertyCollection(props, propRules)); }
/// <summary> /// Return the plugin configuration dialog properties /// </summary> /// <returns>Dialog properties and property-rules</returns> protected override PropertyCollection OnCreatePropertyCollection() { var props = new Property[] { new Int32Property(PropertyNames.PaletteStartIndex, 1, 1, 96), new Int32Property(PropertyNames.PaletteEndIndex, 96, 1, 96), new BooleanProperty(PropertyNames.IgnoreAlpha, true), StaticListChoiceProperty.CreateForEnum <DitheringMethods>(PropertyNames.DitheringMethod, 0, false), new DoubleProperty(PropertyNames.DitheringAmount, 0.3, 0.0, 1.0) }; var rules = new PropertyCollectionRule[] { new SoftMutuallyBoundMinMaxRule <int, Int32Property>( PropertyNames.PaletteStartIndex, PropertyNames.PaletteEndIndex), new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>( PropertyNames.DitheringAmount, PropertyNames.DitheringMethod, DitheringMethods.None, false), new ReadOnlyBoundToValueRule <double, DoubleProperty>( PropertyNames.DitheringMethod, PropertyNames.DitheringAmount, 0.0, false) }; return(new PropertyCollection(props, rules)); }