private PropertyControlInfo(PropertyControlInfo cloneMe) : base(cloneMe) { this.property = cloneMe.property; this.controlType = (StaticListChoiceProperty)cloneMe.controlType.Clone(); this.valueDisplayNames = new Dictionary <object, string>(cloneMe.valueDisplayNames); }
protected override PropertyCollection OnCreatePropertyCollection() { return(new PropertyCollection((IEnumerable <Property>) new List <Property>() { (Property) new DoubleVectorProperty((object)AardvarkEffectPlugin.PropertyNames.CentreOfTile, Pair.Create <double, double>(0.0, 0.0), Pair.Create <double, double>(-3.0, -3.0), Pair.Create <double, double>(3.0, 3.0)), (Property)StaticListChoiceProperty.CreateForEnum <AardvarkEffectPlugin.TilingChoiceOptions>((object)AardvarkEffectPlugin.PropertyNames.TilingChoice, AardvarkEffectPlugin.TilingChoiceOptions.Reflect, false), (Property) new BooleanProperty((object)AardvarkEffectPlugin.PropertyNames.Limit2Ints, true), (Property) new DoubleProperty((object)AardvarkEffectPlugin.PropertyNames.Xzoom, 1.0, 0.25, 11.0), (Property) new DoubleProperty((object)AardvarkEffectPlugin.PropertyNames.Yzoom, 1.0, 0.25, 11.0), (Property) new BooleanProperty((object)AardvarkEffectPlugin.PropertyNames.LinkXY, true), (Property) new DoubleProperty((object)AardvarkEffectPlugin.PropertyNames.TiltAngle, 0.0, -90.0, 90.0), (Property) new DoubleProperty((object)AardvarkEffectPlugin.PropertyNames.TSAngle, 0.0, -180.0, 180.0), (Property) new BooleanProperty((object)AardvarkEffectPlugin.PropertyNames.LimitImgRotAng, false), (Property) new DoubleProperty((object)AardvarkEffectPlugin.PropertyNames.ImgAngle, 0.0, -180.0, 180.0), (Property) new Int32Property((object)AardvarkEffectPlugin.PropertyNames.MaxSample, 11, 1, 21) }, (IEnumerable <PropertyCollectionRule>) new List <PropertyCollectionRule>() { (PropertyCollectionRule) new LinkValuesBasedOnBooleanRule <double, DoubleProperty>(new object[2] { (object)AardvarkEffectPlugin.PropertyNames.Xzoom, (object)AardvarkEffectPlugin.PropertyNames.Yzoom }, (object)AardvarkEffectPlugin.PropertyNames.LinkXY, false), (PropertyCollectionRule) new ReadOnlyBoundToValueRule <double, DoubleProperty>((object)AardvarkEffectPlugin.PropertyNames.TSAngle, (object)AardvarkEffectPlugin.PropertyNames.TiltAngle, 0.0, false) })); }
public override PropertyCollection OnCreateSavePropertyCollection() { List <Property> props = new List <Property>(); props.Add(StaticListChoiceProperty.CreateForEnum <PngBitDepthUIChoices>(PropertyNames.BitDepth, PngBitDepthUIChoices.AutoDetect, false)); props.Add(new Int32Property(PropertyNames.DitherLevel, 7, 0, 8)); props.Add(new Int32Property(PropertyNames.Threshold, 128, 0, 255)); List <PropertyCollectionRule> rules = new List <PropertyCollectionRule>(); rules.Add(new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>( PropertyNames.Threshold, PropertyNames.BitDepth, PngBitDepthUIChoices.Bpp8, true)); rules.Add(new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>( PropertyNames.DitherLevel, PropertyNames.BitDepth, PngBitDepthUIChoices.Bpp8, true)); PropertyCollection pc = new PropertyCollection(props, rules); return(pc); }
/// <summary> /// Add properties to the dialog /// </summary> public override PropertyCollection OnCreateSavePropertyCollection() { Property[] props = new Property[] { new Int32Property(PropertyNames.Quality, 85, 0, 100, false), StaticListChoiceProperty.CreateForEnum(PropertyNames.CompressionSpeed, CompressionSpeed.Fast), CreateChromaSubsampling(), new BooleanProperty(PropertyNames.PreserveExistingTileSize, true), new UriProperty(PropertyNames.ForumLink, new Uri("https://forums.getpaint.net/topic/116233-avif-filetype")), new UriProperty(PropertyNames.GitHubLink, new Uri("https://github.com/0xC0000054/pdn-avif")) }; return(new PropertyCollection(props)); StaticListChoiceProperty CreateChromaSubsampling() { // The list is created manually because some of the YUVChromaSubsampling enumeration values // are used for internal signaling. object[] choiceValues = new object[] { YUVChromaSubsampling.Subsampling420, YUVChromaSubsampling.Subsampling422, YUVChromaSubsampling.Subsampling444 }; int defaultChoiceIndex = Array.IndexOf(choiceValues, YUVChromaSubsampling.Subsampling422); return(new StaticListChoiceProperty(PropertyNames.YUVChromaSubsampling, choiceValues, defaultChoiceIndex)); } }
public override PropertyCollection OnCreateSavePropertyCollection() { List <Property> properties = new List <Property> { StaticListChoiceProperty.CreateForEnum <DdsFileFormat>(PropertyNames.FileFormat, DdsFileFormat.DDS_FORMAT_DXT1, false) }; object[] valueChoices = new object[] { DdsCompressorType.RangeFit, DdsCompressorType.ClusterFit, DdsCompressorType.IterativeFit }; properties.Add(new StaticListChoiceProperty(PropertyNames.CompressorType, valueChoices, 1)); object[] objArray2 = new object[] { DdsErrorMetric.Uniform, DdsErrorMetric.Perceptual }; properties.Add(new StaticListChoiceProperty(PropertyNames.ErrorMetric, objArray2, 1)); properties.Add(new BooleanProperty(PropertyNames.WeightColorByAlpha, false, true)); properties.Add(new BooleanProperty(PropertyNames.GenerateMipMaps, false)); object[] objArray3 = new object[] { ResamplingAlgorithm.Fant, ResamplingAlgorithm.SuperSampling, ResamplingAlgorithm.Bilinear, ResamplingAlgorithm.Bicubic, ResamplingAlgorithm.NearestNeighbor }; properties.Add(new StaticListChoiceProperty(PropertyNames.MipMapResamplingAlgorithm, objArray3, 0)); List <PropertyCollectionRule> rules = new List <PropertyCollectionRule>(); object[] valuesForReadOnly = new object[] { DdsFileFormat.DDS_FORMAT_A8B8G8R8, DdsFileFormat.DDS_FORMAT_A8R8G8B8, DdsFileFormat.DDS_FORMAT_A4R4G4B4, DdsFileFormat.DDS_FORMAT_A1R5G5B5, DdsFileFormat.DDS_FORMAT_R5G6B5, DdsFileFormat.DDS_FORMAT_R8G8B8, DdsFileFormat.DDS_FORMAT_X8B8G8R8, DdsFileFormat.DDS_FORMAT_X8R8G8B8 }; rules.Add(new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>(PropertyNames.ErrorMetric, PropertyNames.FileFormat, valuesForReadOnly, false)); object[] objArray5 = new object[] { DdsFileFormat.DDS_FORMAT_A8B8G8R8, DdsFileFormat.DDS_FORMAT_A8R8G8B8, DdsFileFormat.DDS_FORMAT_A4R4G4B4, DdsFileFormat.DDS_FORMAT_A1R5G5B5, DdsFileFormat.DDS_FORMAT_R5G6B5, DdsFileFormat.DDS_FORMAT_R8G8B8, DdsFileFormat.DDS_FORMAT_X8B8G8R8, DdsFileFormat.DDS_FORMAT_X8R8G8B8 }; rules.Add(new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>(PropertyNames.CompressorType, PropertyNames.FileFormat, objArray5, false)); TupleStruct <object, object>[] sourcePropertyNameValuePairs = new TupleStruct <object, object>[] { Tuple.Create <object, object>(PropertyNames.FileFormat, DdsFileFormat.DDS_FORMAT_A8B8G8R8), Tuple.Create <object, object>(PropertyNames.FileFormat, DdsFileFormat.DDS_FORMAT_A8R8G8B8), Tuple.Create <object, object>(PropertyNames.FileFormat, DdsFileFormat.DDS_FORMAT_A4R4G4B4), Tuple.Create <object, object>(PropertyNames.FileFormat, DdsFileFormat.DDS_FORMAT_A1R5G5B5), Tuple.Create <object, object>(PropertyNames.FileFormat, DdsFileFormat.DDS_FORMAT_R5G6B5), Tuple.Create <object, object>(PropertyNames.FileFormat, DdsFileFormat.DDS_FORMAT_R8G8B8), Tuple.Create <object, object>(PropertyNames.FileFormat, DdsFileFormat.DDS_FORMAT_X8B8G8R8), Tuple.Create <object, object>(PropertyNames.FileFormat, DdsFileFormat.DDS_FORMAT_X8R8G8B8), Tuple.Create <object, object>(PropertyNames.CompressorType, DdsCompressorType.RangeFit) }; rules.Add(new ReadOnlyBoundToNameValuesRule(PropertyNames.WeightColorByAlpha, false, sourcePropertyNameValuePairs)); rules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.MipMapResamplingAlgorithm, PropertyNames.GenerateMipMaps, true)); return(new PropertyCollection(properties, rules)); }
protected override PropertyCollection OnCreatePropertyCollection() { System.Collections.Generic.List <Property> props = new List <Property>(); //= new List<Property>(); props.Add(StaticListChoiceProperty.CreateForEnum <ChoiceList>(PropertyNames.Type, ChoiceList.Primal, false)); props.Add(new Int32Property(PropertyNames.Aperture, 25, 0, 50)); //props.Add(StaticListChoiceProperty.CreateForEnum<Amount2Options>(PropertyNames.Amount2, 0, false)); //props.Add(new BooleanProperty(PropertyNames.Amount3, false)); return(new PropertyCollection(props)); }
public override PropertyCollection OnCreateSavePropertyCollection() { List <Property> props = new List <Property>(); props.Add(StaticListChoiceProperty.CreateForEnum <TgaBitDepthUIChoices>(PropertyNames.BitDepth, TgaBitDepthUIChoices.AutoDetect, false)); props.Add(new BooleanProperty(PropertyNames.RleCompress, true)); return(new PropertyCollection(props)); }
private PropertyControlInfo(Property property) : base() { this.property = property; PropertyControlType defaultControlType = propertyTypeToDefaultControlType[this.property.GetType()]; this.controlType = StaticListChoiceProperty.CreateForEnum <PropertyControlType>(ControlInfoPropertyNames.ControlType, defaultControlType, false); this.controlType.ValueChanged += new EventHandler(ControlType_ValueChanged); this.ControlProperties = controlTypeToProperties[PairUtils.Create(property.GetType(), (PropertyControlType)this.controlType.Value)].Clone(); }
protected override PropertyCollection OnCreatePropertyCollection() { var propertyList = new List <Property> { StaticListChoiceProperty.CreateForEnum(PropertyNames.ColorChart, ColorChart.MacBethColorCheckerChart, false), new BooleanProperty(PropertyNames.IncludeSecondaryColor, false) }; return(new PropertyCollection(propertyList)); }
public override PropertyCollection OnCreateSavePropertyCollection() { List <Property> props = new List <Property> { StaticListChoiceProperty.CreateForEnum(PropertyNames.FileVersion, AbrFileVersion.Version2, false), new BooleanProperty(PropertyNames.RLE, true) }; return(new PropertyCollection(props)); }
public override PropertyCollection OnCreateSavePropertyCollection() { List <Property> properties = new List <Property>() { StaticListChoiceProperty.CreateForEnum <FileVersion>(PropertyNames.FileVersion, FileVersion.Version6, false), StaticListChoiceProperty.CreateForEnum <CompressionFormats>(PropertyNames.CompressionType, CompressionFormats.LZ77, false) }; return(new PropertyCollection(properties)); }
public override PropertyCollection OnCreatePropertyCollection() { return(new PropertyCollection(new Property[] { new Int32Property(PropertyNames.HorizCellSize, 1, 1, 100), new Int32Property(PropertyNames.VerticalCellSize, 1, 1, 100), StaticListChoiceProperty.CreateForEnum <PresetCharacters>(PropertyNames.PresetCharacters, PresetCharacters.AsciiChars, false), new StringProperty(PropertyNames.Characters, string.Empty, 256) }, new[] { new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>(PropertyNames.Characters, PropertyNames.PresetCharacters, PresetCharacters.Custom, true) })); }
public override PropertyCollection OnCreateSavePropertyCollection() { List <Property> properties = new List <Property> { StaticListChoiceProperty.CreateForEnum <BmpBitDepthUIChoices>(PropertyNames.BitDepth, BmpBitDepthUIChoices.AutoDetect, false), new Int32Property(PropertyNames.DitherLevel, 7, 0, 8) }; return(new PropertyCollection(properties, new List <PropertyCollectionRule> { new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>(PropertyNames.DitherLevel, PropertyNames.BitDepth, BmpBitDepthUIChoices.Bpp8, true) })); }
public override PropertyCollection OnCreateSavePropertyCollection() { List <Property> props = new List <Property> { StaticListChoiceProperty.CreateForEnum(PropertyNames.Preset, WebPPreset.Photo, false), new Int32Property(PropertyNames.Quality, 95, 0, 100, false), new BooleanProperty(PropertyNames.KeepMetadata, true, false) }; return(new PropertyCollection(props)); }
protected override PropertyCollection OnCreatePropertyCollection() { List <Property> props = new List <Property>(); props.Add(new StringProperty(PropertyNames.DirSetting, "", 255)); Amount2Options Amount2Default = (Enum.IsDefined(typeof(Amount2Options), 0)) ? (Amount2Options)0 : 0; props.Add(StaticListChoiceProperty.CreateForEnum <Amount2Options>(PropertyNames.DirFiles, Amount2Default, false)); props.Add(new BooleanProperty(PropertyNames.checkk, false)); return(new PropertyCollection(props)); }
public override PropertyCollection OnCreateSavePropertyCollection() { List <Property> props = new() { StaticListChoiceProperty.CreateForEnum(PropertyNames.Preset, WebPPreset.Photo, false), new Int32Property(PropertyNames.Quality, 95, 0, 100, false), new UriProperty(PropertyNames.ForumLink, new Uri("https://forums.getpaint.net/topic/21773-webp-filetype/")), new UriProperty(PropertyNames.GitHubLink, new Uri("https://github.com/0xC0000054/pdn-webp")) }; return(new PropertyCollection(props)); }
protected override PropertyCollection OnCreatePropertyCollection() { var propertyList = new List <Property> { StaticListChoiceProperty.CreateForEnum(PropertyNames.WhiteBalanceMethod, WhiteBalanceMethod.None, false), new DoubleProperty(PropertyNames.RedGain, 1.0, 0.0, 2.0), new DoubleProperty(PropertyNames.GreenGain, 1.0, 0.0, 2.0), new DoubleProperty(PropertyNames.BlueGain, 1.0, 0.0, 2.0) }; return(new PropertyCollection(propertyList)); }
public override PropertyCollection OnCreateSavePropertyCollection() { List <Property> props = new List <Property> { StaticListChoiceProperty.CreateForEnum(PropertyNames.FileFormat, DdsFileFormat.BC1, false), StaticListChoiceProperty.CreateForEnum(PropertyNames.BC7CompressionSpeed, BC7CompressionSpeed.Medium, false), StaticListChoiceProperty.CreateForEnum(PropertyNames.ErrorMetric, DdsErrorMetric.Perceptual, false), new BooleanProperty(PropertyNames.CubeMap, false), new BooleanProperty(PropertyNames.GenerateMipMaps, false), StaticListChoiceProperty.CreateForEnum(PropertyNames.MipMapResamplingAlgorithm, ResamplingAlgorithm.SuperSampling, false), new UriProperty(PropertyNames.ForumLink, new Uri("https://forums.getpaint.net/topic/111731-dds-filetype-plus")), new UriProperty(PropertyNames.GitHubLink, new Uri("https://github.com/0xC0000054/pdn-ddsfiletype-plus")) }; List <PropertyCollectionRule> rules = new List <PropertyCollectionRule> { new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>( PropertyNames.BC7CompressionSpeed, PropertyNames.FileFormat, new object[] { DdsFileFormat.BC6HUnsigned, DdsFileFormat.BC7, DdsFileFormat.BC7Srgb }, true), new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>( PropertyNames.ErrorMetric, PropertyNames.FileFormat, new object[] { DdsFileFormat.BC1, DdsFileFormat.BC1Srgb, DdsFileFormat.BC2, DdsFileFormat.BC2Srgb, DdsFileFormat.BC3, DdsFileFormat.BC3Srgb, DdsFileFormat.BC4Unsigned, DdsFileFormat.BC5Signed, DdsFileFormat.BC5Unsigned, DdsFileFormat.BC6HUnsigned, DdsFileFormat.BC7, DdsFileFormat.BC7Srgb }, true), new ReadOnlyBoundToBooleanRule(PropertyNames.MipMapResamplingAlgorithm, PropertyNames.GenerateMipMaps, true) }; return(new PropertyCollection(props, rules)); }
protected override PropertyCollection OnCreatePropertyCollection() { List <Property> props = new List <Property>(); props.Add(StaticListChoiceProperty.CreateForEnum <Modes>(PropertyNames.Mode, Modes.IsNotSecondary, false)); props.Add(new Int32Property(PropertyNames.LowerThreshold, 0, 0, 300)); props.Add(new Int32Property(PropertyNames.UpperThreshold, 150, 0, 500)); props.Add(new Int32Property(PropertyNames.Tolerance, ((int)(toleranceMax * 0.042)), 0, (int)toleranceMax)); List <PropertyCollectionRule> propRules = new List <PropertyCollectionRule>() { new SoftMutuallyBoundMinMaxRule <int, Int32Property>(PropertyNames.LowerThreshold, PropertyNames.UpperThreshold) }; return(new PropertyCollection(props, propRules)); }
protected override PropertyCollection OnCreatePropertyCollection() { List <Property> props = new List <Property> { StaticListChoiceProperty.CreateForEnum(PropertyNames.Input1, InputColor.Red, false), new StringProperty(PropertyNames.RedFile, string.Empty), StaticListChoiceProperty.CreateForEnum(PropertyNames.Input2, InputColor.Red, false), new StringProperty(PropertyNames.GreenFile, string.Empty), StaticListChoiceProperty.CreateForEnum(PropertyNames.Input3, InputColor.Red, false), new StringProperty(PropertyNames.BlueFile, string.Empty), StaticListChoiceProperty.CreateForEnum(PropertyNames.Input4, InputColor.Red, false), new StringProperty(PropertyNames.AlphaFile, string.Empty), }; return(new PropertyCollection(props)); }
protected override PropertyCollection OnCreatePropertyCollection() { return(new PropertyCollection(new Property[] { StaticListChoiceProperty.CreateForEnum <BackgroundSources>(PropertyNames.BackgroundSource, this._bgSource, false), new Int32Property(PropertyNames.ColorWheel, 0, 0, 0xFFFFFF), new Int32Property(PropertyNames.ToleranceRGB, this._tolRGB, 0, 255), new Int32Property(PropertyNames.ToleranceHue, this._tolHue, 0, 360), new Int32Property(PropertyNames.ToleranceSat, this._tolSat, 0, 100), new Int32Property(PropertyNames.ToleranceVal, this._tolVal, 0, 100), new Int32Property(PropertyNames.DominantColorMaxDeviation, this._domColMaxDev, 1, 255) }, new PropertyCollectionRule[] { new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>(PropertyNames.DominantColorMaxDeviation, PropertyNames.BackgroundSource, new object[] { BackgroundSources.DominantColor, BackgroundSources.ClipboardDominant }, true), new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>(PropertyNames.ColorWheel, PropertyNames.BackgroundSource, BackgroundSources.ColorWheel, true) })); }
protected override PropertyCollection OnCreatePropertyCollection() { List <Property> props = new List <Property>(); props.Add(new DoubleProperty(PropertyNames.AngleChooser, 0, -180, +180)); props.Add(new BooleanProperty(PropertyNames.CheckBox, true)); props.Add(new DoubleProperty(PropertyNames.DoubleSlider, 0, 0, 100)); props.Add(new DoubleVectorProperty(PropertyNames.DoubleVectorPanAndSlider, Pair.Create(0.0, 0.0), Pair.Create(-1.0, -1.0), Pair.Create(+1.0, +1.0))); props.Add(new DoubleVectorProperty(PropertyNames.DoubleVectorSlider, Pair.Create(0.0, 0.0), Pair.Create(-1.0, -1.0), Pair.Create(+1.0, +1.0))); props.Add(new Int32Property(PropertyNames.Int32ColorWheel, 0, 0, 0xffffff)); props.Add(new Int32Property(PropertyNames.Int32IncrementButton, 0, 0, 255)); props.Add(new Int32Property(PropertyNames.Int32Slider, 0, 0, 100)); props.Add(StaticListChoiceProperty.CreateForEnum <System.Drawing.GraphicsUnit>(PropertyNames.StaticListDropDown, GraphicsUnit.Millimeter, false)); props.Add(StaticListChoiceProperty.CreateForEnum <System.Drawing.GraphicsUnit>(PropertyNames.StaticListRadioButton, GraphicsUnit.Document, false)); props.Add(new StringProperty(PropertyNames.StringText, "hello", 100)); return(new PropertyCollection(props)); }
protected override PropertyCollection OnCreatePropertyCollection() { this.Initialize(); return(new PropertyCollection(new Property[] { StaticListChoiceProperty.CreateForEnum <Modes>(PropertyNames.Mode, this._mode, false), new DoubleProperty(PropertyNames.LowerThreshold, this._lowerThres, 0, MaxThresholdValue), new DoubleProperty(PropertyNames.UpperThreshold, this._upperThres, 0, MaxThresholdValue), new Int32Property(PropertyNames.Color, (int)(this._color.ToColor().ToArgb() & 0xFFFFFF), 0, 16777215), new Int32Property(PropertyNames.Color2, (int)(this._color2.ToColor().ToArgb() & 0xFFFFFF), 0, 16777215), StaticListChoiceProperty.CreateForEnum <HueDirection>(PropertyNames.HueDirection, this._hueDirection, false), new DoubleProperty(PropertyNames.Angle, this._angle, 0, 180), new StringProperty(PropertyNames.DifferenceFilter, this._diffX.ToString()), new Int32Property(PropertyNames.SmoothingRadius, this._radius, 0, 100) }, new PropertyCollectionRule[] { new SoftMutuallyBoundMinMaxRule <double, DoubleProperty>(PropertyNames.LowerThreshold, PropertyNames.UpperThreshold) })); }
protected override PropertyCollection OnCreatePropertyCollection() { List <Property> properties = new List <Property> { base.CreatePropertyFromAppSetting(base.Section.AppSettings.UI.EnableHardwareAcceleration), base.CreatePropertyFromAppSetting(base.Section.AppSettings.UI.EnableAnimations), base.CreatePropertyFromAppSetting(base.Section.AppSettings.UI.TranslucentWindows), base.CreatePropertyFromAppSetting(base.Section.AppSettings.UI.ShowTaskbarPreviews), base.CreatePropertyFromAppSetting(base.Section.AppSettings.UI.EnableOverscroll) }; StaticListChoiceProperty item = base.CreatePropertyFromAppSetting <AeroColorScheme>(base.Section.AppSettings.UI.AeroColorScheme); if (ThemeConfig.EffectiveTheme == PdnTheme.Classic) { item.ReadOnly = true; } properties.Add(item); properties.Add(base.CreatePropertyFromAppSetting(base.Section.AppSettings.UI.Language)); return(new PropertyCollection(properties)); }
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)); }
public override PropertyCollection OnCreateSavePropertyCollection() { List <Property> props = new List <Property> { StaticListChoiceProperty.CreateForEnum(PropertyNames.FileFormat, DdsFileFormat.BC1, false), StaticListChoiceProperty.CreateForEnum(PropertyNames.BC7CompressionMode, BC7CompressionMode.Normal, false), StaticListChoiceProperty.CreateForEnum(PropertyNames.ErrorMetric, DdsErrorMetric.Perceptual, false), new BooleanProperty(PropertyNames.GenerateMipMaps, false), StaticListChoiceProperty.CreateForEnum(PropertyNames.MipMapResamplingAlgorithm, MipMapSampling.Fant, false) }; List <PropertyCollectionRule> rules = new List <PropertyCollectionRule> { new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>(PropertyNames.BC7CompressionMode, PropertyNames.FileFormat, new object[] { DdsFileFormat.BC6H, DdsFileFormat.BC7, DdsFileFormat.BC7Srgb }, true), new ReadOnlyBoundToValueRule <object, StaticListChoiceProperty>(PropertyNames.ErrorMetric, PropertyNames.FileFormat, new object[] { DdsFileFormat.B8G8R8A8, DdsFileFormat.B8G8R8X8, DdsFileFormat.R8G8B8A8, DdsFileFormat.B5G5R5A1, DdsFileFormat.B4G4R4A4, DdsFileFormat.B5G6R5 }, false), new ReadOnlyBoundToBooleanRule(PropertyNames.MipMapResamplingAlgorithm, PropertyNames.GenerateMipMaps, true) }; return(new PropertyCollection(props, rules)); }
/// <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)); }
protected override ControlInfo OnCreateConfigUI(PropertyCollection properties) { ControlInfo info = base.OnCreateConfigUI(properties); BooleanSetting enableHardwareAcceleration = base.Section.AppSettings.UI.EnableHardwareAcceleration; info.SetPropertyControlValue(enableHardwareAcceleration.Path, ControlInfoPropertyNames.DisplayName, string.Empty); info.SetPropertyControlValue(enableHardwareAcceleration.Path, ControlInfoPropertyNames.Description, PdnResources.GetString("SettingsDialog.UI.EnableHardwareAcceleration.Description")); BooleanSetting enableAnimations = base.Section.AppSettings.UI.EnableAnimations; info.SetPropertyControlValue(enableAnimations.Path, ControlInfoPropertyNames.DisplayName, string.Empty); info.SetPropertyControlValue(enableAnimations.Path, ControlInfoPropertyNames.Description, PdnResources.GetString("SettingsDialog.UI.EnableAnimations.Description")); BooleanSetting enableAntialiasedSelectionOutline = base.Section.AppSettings.UI.EnableAntialiasedSelectionOutline; info.SetPropertyControlValue(enableAntialiasedSelectionOutline.Path, ControlInfoPropertyNames.DisplayName, string.Empty); info.SetPropertyControlValue(enableAntialiasedSelectionOutline.Path, ControlInfoPropertyNames.Description, PdnResources.GetString("SettingsDialog.UI.EnableAntialiasedSelectionOutline.Description")); BooleanSetting showTaskbarPreviews = base.Section.AppSettings.UI.ShowTaskbarPreviews; info.SetPropertyControlValue(showTaskbarPreviews.Path, ControlInfoPropertyNames.DisplayName, string.Empty); info.SetPropertyControlValue(showTaskbarPreviews.Path, ControlInfoPropertyNames.Description, PdnResources.GetString("SettingsDialog.UI.ShowTaskbarPreviews.Description")); BooleanSetting enableOverscroll = base.Section.AppSettings.UI.EnableOverscroll; info.SetPropertyControlValue(enableOverscroll.Path, ControlInfoPropertyNames.DisplayName, string.Empty); info.SetPropertyControlValue(enableOverscroll.Path, ControlInfoPropertyNames.Description, PdnResources.GetString("SettingsDialog.UI.Overscroll.Description")); BooleanSetting translucentWindows = base.Section.AppSettings.UI.TranslucentWindows; info.SetPropertyControlValue(translucentWindows.Path, ControlInfoPropertyNames.DisplayName, string.Empty); info.SetPropertyControlValue(translucentWindows.Path, ControlInfoPropertyNames.Description, PdnResources.GetString("SettingsDialog.UI.TranslucentWindows.Description")); EnumSetting <AeroColorScheme> aeroColorScheme = base.Section.AppSettings.UI.AeroColorScheme; info.SetPropertyControlValue(aeroColorScheme.Path, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("SettingsDialog.UI.AeroColorScheme.DisplayName")); PropertyControlInfo info2 = info.FindControlForPropertyName(aeroColorScheme.Path); info2.SetValueDisplayName(AeroColorScheme.Blue, PdnResources.GetString("SettingsDialog.UI.AeroColorScheme.Value.Blue")); info2.SetValueDisplayName(AeroColorScheme.Light, PdnResources.GetString("SettingsDialog.UI.AeroColorScheme.Value.Light")); if (ThemeConfig.EffectiveTheme == PdnTheme.Classic) { info.SetPropertyControlValue(aeroColorScheme.Path, ControlInfoPropertyNames.Description, PdnResources.GetString("SettingsDialog.UI.AeroColorScheme.Description.ClassicDisabled")); } CultureInfoSetting language = base.Section.AppSettings.UI.Language; info.SetPropertyControlValue(language.Path, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("SettingsDialog.UI.Language.DisplayName")); info.SetPropertyControlValue(language.Path, ControlInfoPropertyNames.Description, PdnResources.GetString("SettingsDialog.UI.Language.Description")); PropertyControlInfo info3 = info.FindControlForPropertyName(language.Path); StaticListChoiceProperty property = (StaticListChoiceProperty)info3.Property; CultureInfo info4 = new CultureInfo("en-US"); foreach (CultureInfo info5 in property.ValueChoices) { string nativeName; if (info5.Equals(info4)) { nativeName = info5.Parent.NativeName; } else { nativeName = info5.NativeName; } info3.SetValueDisplayName(info5, nativeName); } return(info); }
private PropertyControlInfo(PropertyControlInfo cloneMe) : base(cloneMe) { this.property = cloneMe.property; this.controlType = (StaticListChoiceProperty)cloneMe.controlType.Clone(); this.valueDisplayNames = new Dictionary<object, string>(cloneMe.valueDisplayNames); }
private PropertyControlInfo(Property property) : base() { this.property = property; PropertyControlType defaultControlType = propertyTypeToDefaultControlType[this.property.GetType()]; this.controlType = StaticListChoiceProperty.CreateForEnum<PropertyControlType>(ControlInfoPropertyNames.ControlType, defaultControlType, false); this.controlType.ValueChanged += new EventHandler(ControlType_ValueChanged); this.ControlProperties = controlTypeToProperties[Pair.Create(property.GetType(), (PropertyControlType)this.controlType.Value)].Clone(); }
public override PropertyCollection OnCreateSavePropertyCollection() => new PropertyCollection(new List <Property> { StaticListChoiceProperty.CreateForEnum <TgaBitDepthUIChoices>(PropertyNames.BitDepth, TgaBitDepthUIChoices.AutoDetect, false), new BooleanProperty(PropertyNames.RleCompress, true) });