protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("CloudsEffect.ConfigDialog.ScaleLabel")); configUI.SetPropertyControlValue(PropertyNames.Power, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("CloudsEffect.ConfigDialog.RoughnessLabel")); configUI.SetPropertyControlValue(PropertyNames.Power, ControlInfoPropertyNames.SliderLargeChange, 0.25); configUI.SetPropertyControlValue(PropertyNames.Power, ControlInfoPropertyNames.SliderSmallChange, 0.05); configUI.SetPropertyControlValue(PropertyNames.Power, ControlInfoPropertyNames.UpDownIncrement, 0.01); PropertyControlInfo blendOpControl = configUI.FindControlForPropertyName(PropertyNames.BlendOp); blendOpControl.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = PdnResources.GetString("CloudsEffect.ConfigDialog.BlendModeHeader.Text"); Type[] blendOpTypes = UserBlendOps.GetBlendOps(); foreach (Type blendOpType in blendOpTypes) { string blendOpDisplayName = UserBlendOps.GetBlendOpFriendlyName(blendOpType); blendOpControl.SetValueDisplayName(blendOpType, blendOpDisplayName); } configUI.SetPropertyControlType(PropertyNames.Seed, PropertyControlType.IncrementButton); configUI.SetPropertyControlValue(PropertyNames.Seed, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("CloudsEffect.ConfigDialog.SeedHeader.Text")); configUI.SetPropertyControlValue(PropertyNames.Seed, ControlInfoPropertyNames.ButtonText, PdnResources.GetString("CloudsEffect.ConfigDialog.ReseedButton.Text")); configUI.SetPropertyControlValue(PropertyNames.Seed, ControlInfoPropertyNames.Description, PdnResources.GetString("CloudsEffect.ConfigDialog.UsageLabel")); return(configUI); }
public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props) { ControlInfo info = CreateDefaultSaveConfigUI(props); PropertyControlInfo presetPCI = info.FindControlForPropertyName(PropertyNames.Preset); presetPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = GetString("Preset_DisplayName"); presetPCI.SetValueDisplayName(WebPPreset.Default, GetString("Preset_Default_DisplayName")); presetPCI.SetValueDisplayName(WebPPreset.Drawing, GetString("Preset_Drawing_DisplayName")); presetPCI.SetValueDisplayName(WebPPreset.Icon, GetString("Preset_Icon_DisplayName")); presetPCI.SetValueDisplayName(WebPPreset.Photo, GetString("Preset_Photo_DisplayName")); presetPCI.SetValueDisplayName(WebPPreset.Picture, GetString("Preset_Picture_DisplayName")); presetPCI.SetValueDisplayName(WebPPreset.Text, GetString("Preset_Text_DisplayName")); info.SetPropertyControlValue(PropertyNames.Quality, ControlInfoPropertyNames.DisplayName, GetString("Quality_DisplayName")); #if !PDN_3_5_X PropertyControlInfo forumLinkPCI = info.FindControlForPropertyName(PropertyNames.ForumLink); forumLinkPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = GetString("ForumLink_DisplayName"); forumLinkPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = GetString("ForumLink_Description"); PropertyControlInfo githubLinkPCI = info.FindControlForPropertyName(PropertyNames.GitHubLink); githubLinkPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; githubLinkPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = "GitHub"; // GitHub is a brand name that should not be localized. #endif return(info); }
protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = base.OnCreateConfigUI(props); configUI.SetPropertyControlValue(PropertyNames.Amount, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("PolarInversion.ConfigUI.Amount.DisplayName")); configUI.SetPropertyControlValue(PropertyNames.Amount, ControlInfoPropertyNames.UseExponentialScale, true); configUI.SetPropertyControlValue(PropertyNames.Amount, ControlInfoPropertyNames.SliderLargeChange, 0.25); configUI.SetPropertyControlValue(PropertyNames.Amount, ControlInfoPropertyNames.SliderSmallChange, 0.05); configUI.SetPropertyControlValue(PropertyNames.Amount, ControlInfoPropertyNames.UpDownIncrement, 0.01); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("PolarInversion.ConfigUI.Offset.DisplayName")); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderSmallChangeX, 0.05); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderLargeChangeX, 0.25); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.UpDownIncrementX, 0.01); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderSmallChangeY, 0.05); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderLargeChangeY, 0.25); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.UpDownIncrementY, 0.01); Rectangle selection = this.EnvironmentParameters.GetSelection(base.EnvironmentParameters.SourceSurface.Bounds).GetBoundsInt(); ImageResource propertyValue = ImageResource.FromImage(base.EnvironmentParameters.SourceSurface.CreateAliasedBitmap(selection)); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.StaticImageUnderlay, propertyValue); configUI.SetPropertyControlValue(PropertyNames.EdgeBehavior, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("PolarInversion.ConfigUI.EdgeBehavior.DisplayName")); PropertyControlInfo edgeBehaviorPCI = configUI.FindControlForPropertyName(PropertyNames.EdgeBehavior); edgeBehaviorPCI.SetValueDisplayName(WarpEdgeBehavior.Clamp, PdnResources.GetString("PolarInversion.ConfigUI.EdgeBehavior.Clamp.DisplayName")); edgeBehaviorPCI.SetValueDisplayName(WarpEdgeBehavior.Reflect, PdnResources.GetString("PolarInversion.ConfigUI.EdgeBehavior.Reflect.DisplayName")); edgeBehaviorPCI.SetValueDisplayName(WarpEdgeBehavior.Wrap, PdnResources.GetString("PolarInversion.ConfigUI.EdgeBehavior.Wrap.DisplayName")); configUI.SetPropertyControlValue(PropertyNames.Quality, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("PolarInversion.ConfigUI.Quality.DisplayName")); return(configUI); }
public static ControlInfo CreateDefaultSaveConfigUI(PropertyCollection props) { PanelControlInfo configUI = new PanelControlInfo(); foreach (Property property in props) { PropertyControlInfo propertyControlInfo = PropertyControlInfo.CreateFor(property); foreach (Property controlProperty in propertyControlInfo.ControlProperties) { if (0 == string.Compare(controlProperty.Name, ControlInfoPropertyNames.DisplayName.ToString(), StringComparison.InvariantCulture)) { controlProperty.Value = property.Name; } else if (0 == string.Compare(controlProperty.Name, ControlInfoPropertyNames.ShowResetButton.ToString(), StringComparison.InvariantCulture)) { controlProperty.Value = false; } } configUI.AddChildControl(propertyControlInfo); } return(configUI); }
public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultSaveConfigUI(props); configUI.SetPropertyControlValue( PropertyNames.BitDepth, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("TgaFileType.ConfigUI.BitDepth.DisplayName")); configUI.SetPropertyControlType(PropertyNames.BitDepth, PropertyControlType.RadioButton); PropertyControlInfo bitDepthPCI = configUI.FindControlForPropertyName(PropertyNames.BitDepth); bitDepthPCI.SetValueDisplayName(TgaBitDepthUIChoices.AutoDetect, PdnResources.GetString("TgaFileType.ConfigUI.BitDepth.AutoDetect.DisplayName")); bitDepthPCI.SetValueDisplayName(TgaBitDepthUIChoices.Bpp24, PdnResources.GetString("TgaFileType.ConfigUI.BitDepth.Bpp24.DisplayName")); bitDepthPCI.SetValueDisplayName(TgaBitDepthUIChoices.Bpp32, PdnResources.GetString("TgaFileType.ConfigUI.BitDepth.Bpp32.DisplayName")); configUI.SetPropertyControlValue( PropertyNames.RleCompress, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue( PropertyNames.RleCompress, ControlInfoPropertyNames.Description, PdnResources.GetString("TgaFileType.ConfigUI.RleCompress.Description")); return(configUI); }
public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultSaveConfigUI(props); configUI.SetPropertyControlValue( PropertyNames.BitDepth, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("PngFileType.ConfigUI.BitDepth.DisplayName")); PropertyControlInfo bitDepthPCI = configUI.FindControlForPropertyName(PropertyNames.BitDepth); bitDepthPCI.SetValueDisplayName(PngBitDepthUIChoices.AutoDetect, PdnResources.GetString("PngFileType.ConfigUI.BitDepth.AutoDetect.DisplayName")); bitDepthPCI.SetValueDisplayName(PngBitDepthUIChoices.Bpp32, PdnResources.GetString("PngFileType.ConfigUI.BitDepth.Bpp32.DisplayName")); bitDepthPCI.SetValueDisplayName(PngBitDepthUIChoices.Bpp24, PdnResources.GetString("PngFileType.ConfigUI.BitDepth.Bpp24.DisplayName")); bitDepthPCI.SetValueDisplayName(PngBitDepthUIChoices.Bpp8, PdnResources.GetString("PngFileType.ConfigUI.BitDepth.Bpp8.DisplayName")); configUI.SetPropertyControlType(PropertyNames.BitDepth, PropertyControlType.RadioButton); configUI.SetPropertyControlValue( PropertyNames.DitherLevel, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("PngFileType.ConfigUI.DitherLevel.DisplayName")); configUI.SetPropertyControlValue( PropertyNames.Threshold, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("PngFileType.ConfigUI.Threshold.DisplayName")); configUI.SetPropertyControlValue( PropertyNames.Threshold, ControlInfoPropertyNames.Description, PdnResources.GetString("PngFileType.ConfigUI.Threshold.Description")); return(configUI); }
protected override PropertyBasedSaveConfigToken CreateTokenFromWidget() { PropertyCollection props = this.originalProps.Clone(); foreach (string propertyName in props.PropertyNames) { PropertyControlInfo srcPropertyControlInfo = this.configUI.FindControlForPropertyName(propertyName); if (srcPropertyControlInfo != null) { Property srcProperty = srcPropertyControlInfo.Property; Property dstProperty = props[propertyName]; if (dstProperty.ReadOnly) { dstProperty.ReadOnly = false; dstProperty.Value = srcProperty.Value; dstProperty.ReadOnly = true; } else { dstProperty.Value = srcProperty.Value; } } } PropertyBasedSaveConfigToken pbsct = new PropertyBasedSaveConfigToken(props); return(pbsct); }
public PropertyBasedSaveConfigWidget(PropertyBasedFileType fileType, PropertyCollection props, ControlInfo configUI) : base(fileType) { this.originalProps = props.Clone(); this.configUI = configUI.Clone(); // Make sure that the properties in props and configUI are not the same objects foreach (Property property in props) { PropertyControlInfo pci = this.configUI.FindControlForPropertyName(property.Name); if (pci != null) { if (object.ReferenceEquals(property, pci.Property)) { throw new ArgumentException("Property references in propertyCollection must not be the same as those in configUI"); } } } SuspendLayout(); this.configUIControl = (Control)this.configUI.CreateConcreteControl(this); this.configUIControl.SuspendLayout(); this.configUIControl.TabIndex = 0; // Set up data binding foreach (Property property in this.originalProps) { PropertyControlInfo pci = this.configUI.FindControlForPropertyName(property.Name); if (pci == null) { throw new InvalidOperationException("Every property must have a control associated with it"); } else { Property controlsProperty = pci.Property; // ASSUMPTION: We assume that the concrete WinForms Control holds a reference to // the same Property instance as the ControlInfo it was created from. controlsProperty.ValueChanged += ControlsProperty_ValueChanged; } } this.Controls.Add(this.configUIControl); this.configUIControl.ResumeLayout(false); ResumeLayout(false); PerformLayout(); }
protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlValue(PropertyNames.DirSetting, ControlInfoPropertyNames.DisplayName, "Directory"); configUI.SetPropertyControlValue(PropertyNames.DirFiles, ControlInfoPropertyNames.DisplayName, "File"); configUI.SetPropertyControlValue(PropertyNames.checkk, ControlInfoPropertyNames.DisplayName, "Checkk"); PropertyControlInfo Amount2Control = configUI.FindControlForPropertyName(PropertyNames.DirFiles); Amount2Control.SetValueDisplayName(Amount2Options.CLUTFilename, ""); return(configUI); }
public static ControlInfo CreateDefaultConfigUI(IEnumerable <Property> props) { PanelControlInfo configUI = new PanelControlInfo(); foreach (Property property in props) { PropertyControlInfo propertyControlInfo = PropertyControlInfo.CreateFor(property); propertyControlInfo.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = property.Name; configUI.AddChildControl(propertyControlInfo); } return(configUI); }
public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props) { ControlInfo info = PropertyBasedFileType.CreateDefaultSaveConfigUI(props); info.SetPropertyControlValue(PropertyNames.BitDepth, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("BmpFileType.ConfigUI.BitDepth.DisplayName")); PropertyControlInfo info2 = info.FindControlForPropertyName(PropertyNames.BitDepth); info2.SetValueDisplayName(BmpBitDepthUIChoices.AutoDetect, PdnResources.GetString("BmpFileType.ConfigUI.BitDepth.AutoDetect.DisplayName")); info2.SetValueDisplayName(BmpBitDepthUIChoices.Bpp24, PdnResources.GetString("BmpFileType.ConfigUI.BitDepth.Bpp24.DisplayName")); info2.SetValueDisplayName(BmpBitDepthUIChoices.Bpp8, PdnResources.GetString("BmpFileType.ConfigUI.BitDepth.Bpp8.DisplayName")); info.SetPropertyControlType(PropertyNames.BitDepth, PropertyControlType.RadioButton); info.SetPropertyControlValue(PropertyNames.DitherLevel, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("BmpFileType.ConfigUI.DitherLevel.DisplayName")); return(info); }
protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlValue(PropertyNames.Radius, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("ReduceNoise.Radius.DisplayName")); configUI.SetPropertyControlValue(PropertyNames.Strength, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("ReduceNoise.Strength.DisplayName")); PropertyControlInfo strengthControlInfo = configUI.FindControlForPropertyName(PropertyNames.Strength); configUI.SetPropertyControlValue(PropertyNames.Strength, ControlInfoPropertyNames.UpDownIncrement, 0.01); configUI.SetPropertyControlValue(PropertyNames.Strength, ControlInfoPropertyNames.SliderSmallChange, 0.01); configUI.SetPropertyControlValue(PropertyNames.Strength, ControlInfoPropertyNames.SliderLargeChange, 0.1); return(configUI); }
protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlType(PropertyNames.Mode, PropertyControlType.RadioButton); PropertyControlInfo modes = configUI.FindControlForPropertyName(PropertyNames.Mode); modes.SetValueDisplayName(Modes.IsNotSecondary, "Ignore Within Tolerance of Secondary Color"); modes.SetValueDisplayName(Modes.IsPrimary, "Add Within Tolerance of Primary Color"); configUI.SetPropertyControlValue(PropertyNames.Mode, ControlInfoPropertyNames.DisplayName, "Clustering Mode"); configUI.SetPropertyControlValue(PropertyNames.LowerThreshold, ControlInfoPropertyNames.DisplayName, "Cluster Size Lower Threshold"); configUI.SetPropertyControlValue(PropertyNames.UpperThreshold, ControlInfoPropertyNames.DisplayName, "Cluster Size Upper Threshold"); configUI.SetPropertyControlValue(PropertyNames.Tolerance, ControlInfoPropertyNames.DisplayName, "Tolerance ‰"); return(configUI); }
public override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo info = CreateDefaultConfigUI(props); info.SetPropertyControlValue(PropertyNames.HorizCellSize, ControlInfoPropertyNames.DisplayName, "Horizontal cell size"); info.SetPropertyControlValue(PropertyNames.VerticalCellSize, ControlInfoPropertyNames.DisplayName, "Vertical cell size"); info.SetPropertyControlValue(PropertyNames.PresetCharacters, ControlInfoPropertyNames.DisplayName, "Preset characters"); info.SetPropertyControlType(PropertyNames.PresetCharacters, PropertyControlType.RadioButton); PropertyControlInfo info2 = info.FindControlForPropertyName(PropertyNames.PresetCharacters); info2.SetValueDisplayName(PresetCharacters.AsciiChars, asciiChars); info2.SetValueDisplayName(PresetCharacters.Blocks, blocks); info2.SetValueDisplayName(PresetCharacters.Custom, "Custom (does not work with previewing and opening)"); info.SetPropertyControlValue(PropertyNames.Characters, ControlInfoPropertyNames.DisplayName, "Custom characters"); return(info); }
/// <summary> /// Adapt properties in the dialog (DisplayName, ...) /// </summary> public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultSaveConfigUI(props); PropertyControlInfo qualityPCI = configUI.FindControlForPropertyName(PropertyNames.Quality); qualityPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = this.strings.GetString("Quality_DisplayName"); qualityPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = string.Empty; PropertyControlInfo compressionSpeedPCI = configUI.FindControlForPropertyName(PropertyNames.CompressionSpeed); compressionSpeedPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = this.strings.GetString("CompressionSpeed_DisplayName"); compressionSpeedPCI.SetValueDisplayName(CompressionSpeed.Fast, this.strings.GetString("CompressionSpeed_Fast_DisplayName")); compressionSpeedPCI.SetValueDisplayName(CompressionSpeed.Medium, this.strings.GetString("CompressionSpeed_Medium_DisplayName")); compressionSpeedPCI.SetValueDisplayName(CompressionSpeed.Slow, this.strings.GetString("CompressionSpeed_Slow_DisplayName")); compressionSpeedPCI.SetValueDisplayName(CompressionSpeed.VerySlow, this.strings.GetString("CompressionSpeed_VerySlow_DisplayName")); PropertyControlInfo subsamplingPCI = configUI.FindControlForPropertyName(PropertyNames.YUVChromaSubsampling); subsamplingPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = this.strings.GetString("ChromaSubsampling_DisplayName"); subsamplingPCI.SetValueDisplayName(YUVChromaSubsampling.Subsampling420, this.strings.GetString("ChromaSubsampling_420_DisplayName")); subsamplingPCI.SetValueDisplayName(YUVChromaSubsampling.Subsampling422, this.strings.GetString("ChromaSubsampling_422_DisplayName")); subsamplingPCI.SetValueDisplayName(YUVChromaSubsampling.Subsampling444, this.strings.GetString("ChromaSubsampling_444_DisplayName")); PropertyControlInfo preserveExistingTileSizePCI = configUI.FindControlForPropertyName(PropertyNames.PreserveExistingTileSize); preserveExistingTileSizePCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; preserveExistingTileSizePCI.ControlProperties[ControlInfoPropertyNames.Description].Value = this.strings.GetString("PreserveExistingTileSize_Description"); PropertyControlInfo forumLinkPCI = configUI.FindControlForPropertyName(PropertyNames.ForumLink); forumLinkPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = this.strings.GetString("ForumLink_DisplayName"); forumLinkPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = this.strings.GetString("ForumLink_Description"); PropertyControlInfo githubLinkPCI = configUI.FindControlForPropertyName(PropertyNames.GitHubLink); githubLinkPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; githubLinkPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = "GitHub"; // GitHub is a brand name that should not be localized. return(configUI); }
public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props) { ControlInfo info = CreateDefaultSaveConfigUI(props); PropertyControlInfo presetPCI = info.FindControlForPropertyName(PropertyNames.Preset); presetPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = Resources.Preset_DisplayName; presetPCI.SetValueDisplayName(WebPPreset.Default, Resources.Preset_Default_DisplayName); presetPCI.SetValueDisplayName(WebPPreset.Drawing, Resources.Preset_Drawing_DisplayName); presetPCI.SetValueDisplayName(WebPPreset.Icon, Resources.Preset_Icon_DisplayName); presetPCI.SetValueDisplayName(WebPPreset.Photo, Resources.Preset_Photo_DisplayName); presetPCI.SetValueDisplayName(WebPPreset.Picture, Resources.Preset_Picture_DisplayName); presetPCI.SetValueDisplayName(WebPPreset.Text, Resources.Preset_Text_DisplayName); info.SetPropertyControlValue(PropertyNames.Quality, ControlInfoPropertyNames.DisplayName, Resources.Quality_DisplayName); info.SetPropertyControlValue(PropertyNames.KeepMetadata, ControlInfoPropertyNames.DisplayName, string.Empty); info.SetPropertyControlValue(PropertyNames.KeepMetadata, ControlInfoPropertyNames.Description, Resources.KeepMetadata_Description); return(info); }
protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlValue(PropertyNames.Text, ControlInfoPropertyNames.DisplayName, L10nStrings.Text); configUI.SetPropertyControlValue(PropertyNames.TextRepeat, ControlInfoPropertyNames.DisplayName, L10nStrings.TextRepeat); configUI.SetPropertyControlValue(PropertyNames.FontSize, ControlInfoPropertyNames.DisplayName, L10nStrings.FontSize); configUI.SetPropertyControlValue(PropertyNames.Font, ControlInfoPropertyNames.DisplayName, L10nStrings.Font); PropertyControlInfo Amount4FontFamilyControl = configUI.FindControlForPropertyName(PropertyNames.Font); foreach (FontFamily ff in FontUtil.UsableFontFamilies) { Amount4FontFamilyControl.SetValueDisplayName(ff, ff.Name); } configUI.SetPropertyControlValue(PropertyNames.Bold, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Bold, ControlInfoPropertyNames.Description, L10nStrings.Bold); configUI.SetPropertyControlValue(PropertyNames.Italic, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Italic, ControlInfoPropertyNames.Description, L10nStrings.Italic); configUI.SetPropertyControlValue(PropertyNames.Underline, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Underline, ControlInfoPropertyNames.Description, L10nStrings.Underline); configUI.SetPropertyControlValue(PropertyNames.Strikeout, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Strikeout, ControlInfoPropertyNames.Description, L10nStrings.Strikeout); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.DisplayName, L10nStrings.Offset); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderSmallChangeX, 0.05); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderLargeChangeX, 0.25); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.UpDownIncrementX, 0.01); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderSmallChangeY, 0.05); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderLargeChangeY, 0.25); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.UpDownIncrementY, 0.01); Rectangle selection9 = EnvironmentParameters.SelectionBounds; ImageResource imageResource9 = ImageResource.FromImage(EnvironmentParameters.SourceSurface.CreateAliasedBitmap(selection9)); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.StaticImageUnderlay, imageResource9); configUI.SetPropertyControlValue(PropertyNames.BackColor, ControlInfoPropertyNames.DisplayName, L10nStrings.BackColor); configUI.SetPropertyControlType(PropertyNames.BackColor, PropertyControlType.ColorWheel); return(configUI); }
protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlValue(C.Properties.Text.ToString(), ControlInfoPropertyNames.Multiline, true); configUI.SetPropertyControlValue(C.Properties.Bold.ToString(), ControlInfoPropertyNames.DisplayName, "Formatting"); #pragma warning disable S4142 // Duplicate values should not be passed as arguments configUI.SetPropertyControlValue(C.Properties.Bold.ToString(), ControlInfoPropertyNames.Description, C.Properties.Bold.ToString()); configUI.SetPropertyControlValue(C.Properties.Italic.ToString(), ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(C.Properties.Italic.ToString(), ControlInfoPropertyNames.Description, C.Properties.Italic.ToString()); configUI.SetPropertyControlValue(C.Properties.Underline.ToString(), ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(C.Properties.Underline.ToString(), ControlInfoPropertyNames.Description, C.Properties.Underline.ToString()); configUI.SetPropertyControlValue(C.Properties.Strikeout.ToString(), ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(C.Properties.Strikeout.ToString(), ControlInfoPropertyNames.Description, C.Properties.Strikeout.ToString()); #pragma warning restore S4142 // Duplicate values should not be passed as arguments configUI.SetPropertyControlValue(C.Properties.LetterSpacing.ToString(), ControlInfoPropertyNames.SliderLargeChange, 0.25); configUI.SetPropertyControlValue(C.Properties.LetterSpacing.ToString(), ControlInfoPropertyNames.SliderSmallChange, 0.01); configUI.SetPropertyControlValue(C.Properties.LetterSpacing.ToString(), ControlInfoPropertyNames.UpDownIncrement, 0.01); configUI.SetPropertyControlValue(C.Properties.LineSpacing.ToString(), ControlInfoPropertyNames.SliderLargeChange, 0.25); configUI.SetPropertyControlValue(C.Properties.LineSpacing.ToString(), ControlInfoPropertyNames.SliderSmallChange, 0.01); configUI.SetPropertyControlValue(C.Properties.LineSpacing.ToString(), ControlInfoPropertyNames.UpDownIncrement, 0.01); PropertyControlInfo fontControl = configUI.FindControlForPropertyName(C.Properties.FontFamily); foreach (FontFamily fontFamily in fontFamilies) { fontControl.SetValueDisplayName(fontFamily, fontFamily.Name); } return(configUI); }
public PropertyBasedSettingsPage(SettingsDialogSection section) : base(section) { this.propertyCollection = this.OnCreatePropertyCollection().Clone(); this.propertyUIInfo = this.OnCreateConfigUI(this.propertyCollection.Clone()); this.propertyUI = (Control)this.propertyUIInfo.CreateConcreteControl(typeof(Control)); foreach (Property property in this.propertyCollection) { PropertyControlInfo info = this.propertyUIInfo.FindControlForPropertyName(property.Name); if (info == null) { ExceptionUtil.ThrowInvalidOperationException("Every property must have a control associated with it"); } else { Property controlsProperty = info.Property; controlsProperty.ValueChanged += (s, e) => this.PropertyValueChanged(controlsProperty, e.Value); } } base.SuspendLayout(); this.propertyUI.Location = new Point(0, 0); base.Controls.Add(this.propertyUI); base.ResumeLayout(false); }
protected override void LoadIntoTokenFromDialog(PropertyBasedEffectConfigToken writeValuesHere) { foreach (string propertyName in this.EffectToken.PropertyNames) { PropertyControlInfo srcPropertyControlInfo = this.configUI.FindControlForPropertyName(propertyName); if (srcPropertyControlInfo != null) { Property srcProperty = srcPropertyControlInfo.Property; Property dstProperty = writeValuesHere.GetProperty(srcProperty.Name); if (dstProperty.ReadOnly) { dstProperty.ReadOnly = false; dstProperty.Value = srcProperty.Value; dstProperty.ReadOnly = true; } else { dstProperty.Value = srcProperty.Value; } } } }
private void InitDialogFromTokenImpl(PropertyBasedEffectConfigToken effectTokenCopy) { foreach (string propertyName in effectTokenCopy.PropertyNames) { Property srcProperty = effectTokenCopy.GetProperty <Property>(propertyName); PropertyControlInfo dstPropertyControlInfo = this.configUI.FindControlForPropertyName(propertyName); if (dstPropertyControlInfo != null) { Property dstProperty = dstPropertyControlInfo.Property; if (dstProperty.ReadOnly) { dstProperty.ReadOnly = false; dstProperty.Value = srcProperty.Value; dstProperty.ReadOnly = true; } else { dstProperty.Value = srcProperty.Value; } } } }
protected override void InitWidgetFromToken(PropertyBasedSaveConfigToken sourceToken) { foreach (string propertyName in sourceToken.PropertyNames) { Property srcProperty = sourceToken.GetProperty(propertyName); PropertyControlInfo dstPropertyControlInfo = this.configUI.FindControlForPropertyName(propertyName); if (dstPropertyControlInfo != null) { Property dstProperty = dstPropertyControlInfo.Property; if (dstProperty.ReadOnly) { dstProperty.ReadOnly = false; dstProperty.Value = srcProperty.Value; dstProperty.ReadOnly = true; } else { dstProperty.Value = srcProperty.Value; } } } }
protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.DisplayName, L10nStrings.Scale); configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.SliderLargeChange, 0.25); configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.SliderSmallChange, 0.05); configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.UpDownIncrement, 0.001); configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.DecimalPlaces, 3); configUI.SetPropertyControlValue(PropertyNames.LineWidth, ControlInfoPropertyNames.DisplayName, L10nStrings.LineWidth); configUI.SetPropertyControlValue(PropertyNames.Pattern, ControlInfoPropertyNames.DisplayName, L10nStrings.Pattern); PropertyControlInfo patternControl = configUI.FindControlForPropertyName(PropertyNames.Pattern); patternControl.SetValueDisplayName(Pattern.AltHorVer, L10nStrings.AltHorVer); patternControl.SetValueDisplayName(Pattern.AltNone, L10nStrings.AltNone); patternControl.SetValueDisplayName(Pattern.AltHor, L10nStrings.AltHor); patternControl.SetValueDisplayName(Pattern.AltVer, L10nStrings.AltVer); configUI.SetPropertyControlValue(PropertyNames.Transparent, ControlInfoPropertyNames.DisplayName, L10nStrings.LineColor); configUI.SetPropertyControlValue(PropertyNames.Transparent, ControlInfoPropertyNames.Description, L10nStrings.Transparent); configUI.SetPropertyControlValue(PropertyNames.LineColor, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlType(PropertyNames.LineColor, PropertyControlType.ColorWheel); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.DisplayName, L10nStrings.Position); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderSmallChangeX, 0.05); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderLargeChangeX, 0.25); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.UpDownIncrementX, 0.001); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderSmallChangeY, 0.05); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderLargeChangeY, 0.25); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.UpDownIncrementY, 0.001); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.DecimalPlaces, 3); Rectangle selBounds = EnvironmentParameters.SelectionBounds; ImageResource selImage = ImageResource.FromImage(EnvironmentParameters.SourceSurface.CreateAliasedBitmap(selBounds)); configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.StaticImageUnderlay, selImage); return(configUI); }
public PropertyBasedEffectConfigDialog(PropertyCollection propertyCollection, ControlInfo configUI, PropertyCollection windowProperties) : base(propertyCollection) { this.windowProperties = windowProperties.Clone(); this.configUI = (ControlInfo)configUI.Clone(); // Make sure that the properties in props and configUI are not the same objects foreach (Property property in propertyCollection) { PropertyControlInfo pci = this.configUI.FindControlForPropertyName(property.Name); if (pci != null && object.ReferenceEquals(property, pci.Property)) { throw new ArgumentException("Property references in propertyCollection must not be the same as those in configUI"); } } SuspendLayout(); this.okButton = new Button(); this.cancelButton = new Button(); this.cancelButton.Name = "cancelButton"; this.configUIPanel = new Panel(); this.configUIControl = (Control)this.configUI.CreateConcreteControl(this); this.configUIControl.Location = new Point(0, 0); this.configUIPanel.SuspendLayout(); this.configUIControl.SuspendLayout(); this.okButton.Name = "okButton"; this.okButton.AutoSize = true; this.okButton.Click += OkButton_Click; this.okButton.Text = PdnResources.GetString("Form.OkButton.Text"); this.okButton.FlatStyle = FlatStyle.System; this.cancelButton.AutoSize = true; this.cancelButton.Click += CancelButton_Click; this.cancelButton.Text = PdnResources.GetString("Form.CancelButton.Text"); this.cancelButton.FlatStyle = FlatStyle.System; this.configUIPanel.Name = "configUIPanel"; this.configUIPanel.TabStop = false; this.configUIPanel.Controls.Add(this.configUIControl); this.configUIControl.Name = "configUIControl"; this.etchedLine = new EtchedLine(); this.etchedLine.Name = "etchedLine"; Controls.AddRange( new Control[] { this.okButton, this.cancelButton, this.etchedLine, this.configUIPanel }); int tabIndex = 0; this.configUIControl.TabIndex = tabIndex; ++tabIndex; // Set up data binding foreach (Property property in this.properties) { PropertyControlInfo pci = this.configUI.FindControlForPropertyName(property.Name); if (pci == null) { throw new InvalidOperationException("Every property must have a control associated with it"); } else { Property controlsProperty = pci.Property; // ASSUMPTION: We assume that the concrete WinForms Control holds a reference to // the same Property instance as the ControlInfo it was created from. controlsProperty.ValueChanged += ControlsProperty_ValueChanged; } } this.okButton.TabIndex = tabIndex; ++tabIndex; this.cancelButton.TabIndex = tabIndex; ++tabIndex; AcceptButton = this.okButton; CancelButton = this.cancelButton; bool isSizable = (bool)this.windowProperties[ControlInfoPropertyNames.WindowIsSizable].Value; FormBorderStyle = isSizable ? FormBorderStyle.Sizable : FormBorderStyle.FixedDialog; Text = (string)this.windowProperties[ControlInfoPropertyNames.WindowTitle].Value; ClientSize = new Size(UI.ScaleWidth(defaultClientWidth96Dpi), UI.ScaleHeight(defaultClientHeight96Dpi)); this.configUIControl.ResumeLayout(false); this.configUIPanel.ResumeLayout(false); ResumeLayout(false); PerformLayout(); }
public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultSaveConfigUI(props); PropertyControlInfo formatPCI = configUI.FindControlForPropertyName(PropertyNames.FileFormat); formatPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; formatPCI.SetValueDisplayName(DdsFileFormat.BC1, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC1)); formatPCI.SetValueDisplayName(DdsFileFormat.BC1Srgb, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC1Srgb)); formatPCI.SetValueDisplayName(DdsFileFormat.BC2, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC2)); formatPCI.SetValueDisplayName(DdsFileFormat.BC2Srgb, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC2Srgb)); formatPCI.SetValueDisplayName(DdsFileFormat.BC3, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC3)); formatPCI.SetValueDisplayName(DdsFileFormat.BC3Srgb, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC3Srgb)); formatPCI.SetValueDisplayName(DdsFileFormat.BC4Unsigned, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC4Unsigned)); formatPCI.SetValueDisplayName(DdsFileFormat.BC5Unsigned, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC5Unsigned)); formatPCI.SetValueDisplayName(DdsFileFormat.BC5Signed, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC5Signed)); formatPCI.SetValueDisplayName(DdsFileFormat.BC6HUnsigned, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC6HUnsigned)); formatPCI.SetValueDisplayName(DdsFileFormat.BC7, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC7)); formatPCI.SetValueDisplayName(DdsFileFormat.BC7Srgb, GetString(DdsFileTypePlusStringName.DdsFileFormat_BC7Srgb)); formatPCI.SetValueDisplayName(DdsFileFormat.B8G8R8A8, GetString(DdsFileTypePlusStringName.DdsFileFormat_B8G8R8A8)); formatPCI.SetValueDisplayName(DdsFileFormat.B8G8R8X8, GetString(DdsFileTypePlusStringName.DdsFileFormat_B8G8R8X8)); formatPCI.SetValueDisplayName(DdsFileFormat.R8G8B8A8, GetString(DdsFileTypePlusStringName.DdsFileFormat_R8G8B8A8)); formatPCI.SetValueDisplayName(DdsFileFormat.B5G5R5A1, GetString(DdsFileTypePlusStringName.DdsFileFormat_B5G5R5A1)); formatPCI.SetValueDisplayName(DdsFileFormat.B4G4R4A4, GetString(DdsFileTypePlusStringName.DdsFileFormat_B4G4R4A4)); formatPCI.SetValueDisplayName(DdsFileFormat.B5G6R5, GetString(DdsFileTypePlusStringName.DdsFileFormat_B5G6R5)); PropertyControlInfo compresionModePCI = configUI.FindControlForPropertyName(PropertyNames.BC7CompressionMode); compresionModePCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = GetString(DdsFileTypePlusStringName.BC7CompressionMode_DisplayName); compresionModePCI.SetValueDisplayName(BC7CompressionMode.Fast, GetString(DdsFileTypePlusStringName.BC7CompressionMode_Fast)); compresionModePCI.SetValueDisplayName(BC7CompressionMode.Normal, GetString(DdsFileTypePlusStringName.BC7CompressionMode_Normal)); compresionModePCI.SetValueDisplayName(BC7CompressionMode.Slow, GetString(DdsFileTypePlusStringName.BC7CompressionMode_Slow)); PropertyControlInfo errorMetricPCI = configUI.FindControlForPropertyName(PropertyNames.ErrorMetric); errorMetricPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = GetString(DdsFileTypePlusStringName.ErrorMetric_DisplayName); errorMetricPCI.ControlType.Value = PropertyControlType.RadioButton; errorMetricPCI.SetValueDisplayName(DdsErrorMetric.Perceptual, GetString(DdsFileTypePlusStringName.ErrorMetric_Perceptual)); errorMetricPCI.SetValueDisplayName(DdsErrorMetric.Uniform, GetString(DdsFileTypePlusStringName.ErrorMetric_Uniform)); PropertyControlInfo cubemapPCI = configUI.FindControlForPropertyName(PropertyNames.CubeMap); cubemapPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; cubemapPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = GetString(DdsFileTypePlusStringName.CubeMap_Description); PropertyControlInfo generateMipPCI = configUI.FindControlForPropertyName(PropertyNames.GenerateMipMaps); generateMipPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; generateMipPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = GetString(DdsFileTypePlusStringName.GenerateMipMaps_Description); PropertyControlInfo mipResamplingPCI = configUI.FindControlForPropertyName(PropertyNames.MipMapResamplingAlgorithm); mipResamplingPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; mipResamplingPCI.SetValueDisplayName(ResamplingAlgorithm.NearestNeighbor, GetString(DdsFileTypePlusStringName.ResamplingAlgorithm_NearestNeighbor)); mipResamplingPCI.SetValueDisplayName(ResamplingAlgorithm.Bicubic, GetString(DdsFileTypePlusStringName.ResamplingAlgorithm_Bicubic)); mipResamplingPCI.SetValueDisplayName(ResamplingAlgorithm.Bilinear, GetString(DdsFileTypePlusStringName.ResamplingAlgorithm_Bilinear)); mipResamplingPCI.SetValueDisplayName(ResamplingAlgorithm.Fant, GetString(DdsFileTypePlusStringName.ResamplingAlgorithm_Fant)); mipResamplingPCI.SetValueDisplayName(ResamplingAlgorithm.SuperSampling, GetString(DdsFileTypePlusStringName.ResamplingAlgorithm_SuperSampling)); PropertyControlInfo forumLinkPCI = configUI.FindControlForPropertyName(PropertyNames.ForumLink); forumLinkPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = GetString(DdsFileTypePlusStringName.ForumLink_DisplayName); forumLinkPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = GetString(DdsFileTypePlusStringName.ForumLink_Description); PropertyControlInfo githubLinkPCI = configUI.FindControlForPropertyName(PropertyNames.GitHubLink); githubLinkPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; githubLinkPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = "GitHub"; // GitHub is a brand name that should not be localized. return(configUI); }
public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultSaveConfigUI(props); PropertyControlInfo formatPCI = configUI.FindControlForPropertyName(PropertyNames.FileFormat); formatPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; formatPCI.SetValueDisplayName(DdsFileFormat.BC1, this.strings.GetString("DdsFileFormat_BC1")); formatPCI.SetValueDisplayName(DdsFileFormat.BC1Srgb, this.strings.GetString("DdsFileFormat_BC1Srgb")); formatPCI.SetValueDisplayName(DdsFileFormat.BC2, this.strings.GetString("DdsFileFormat_BC2")); formatPCI.SetValueDisplayName(DdsFileFormat.BC2Srgb, this.strings.GetString("DdsFileFormat_BC2Srgb")); formatPCI.SetValueDisplayName(DdsFileFormat.BC3, this.strings.GetString("DdsFileFormat_BC3")); formatPCI.SetValueDisplayName(DdsFileFormat.BC3Srgb, this.strings.GetString("DdsFileFormat_BC3Srgb")); formatPCI.SetValueDisplayName(DdsFileFormat.BC4Unsigned, this.strings.GetString("DdsFileFormat_BC4Unsigned")); formatPCI.SetValueDisplayName(DdsFileFormat.BC5Unsigned, this.strings.GetString("DdsFileFormat_BC5Unsigned")); formatPCI.SetValueDisplayName(DdsFileFormat.BC5Signed, this.strings.GetString("DdsFileFormat_BC5Signed")); formatPCI.SetValueDisplayName(DdsFileFormat.BC6HUnsigned, this.strings.GetString("DdsFileFormat_BC6HUnsigned")); formatPCI.SetValueDisplayName(DdsFileFormat.BC7, this.strings.GetString("DdsFileFormat_BC7")); formatPCI.SetValueDisplayName(DdsFileFormat.BC7Srgb, this.strings.GetString("DdsFileFormat_BC7Srgb")); formatPCI.SetValueDisplayName(DdsFileFormat.B8G8R8A8, this.strings.GetString("DdsFileFormat_B8G8R8A8")); formatPCI.SetValueDisplayName(DdsFileFormat.B8G8R8A8Srgb, this.strings.GetString("DdsFileFormat_B8G8R8A8Srgb")); formatPCI.SetValueDisplayName(DdsFileFormat.B8G8R8X8, this.strings.GetString("DdsFileFormat_B8G8R8X8")); formatPCI.SetValueDisplayName(DdsFileFormat.B8G8R8X8Srgb, this.strings.GetString("DdsFileFormat_B8G8R8X8Srgb")); formatPCI.SetValueDisplayName(DdsFileFormat.R8G8B8A8, this.strings.GetString("DdsFileFormat_R8G8B8A8")); formatPCI.SetValueDisplayName(DdsFileFormat.R8G8B8A8Srgb, this.strings.GetString("DdsFileFormat_R8G8B8A8Srgb")); formatPCI.SetValueDisplayName(DdsFileFormat.R8G8B8X8, this.strings.GetString("DdsFileFormat_R8G8B8X8")); formatPCI.SetValueDisplayName(DdsFileFormat.B5G5R5A1, this.strings.GetString("DdsFileFormat_B5G5R5A1")); formatPCI.SetValueDisplayName(DdsFileFormat.B4G4R4A4, this.strings.GetString("DdsFileFormat_B4G4R4A4")); formatPCI.SetValueDisplayName(DdsFileFormat.B5G6R5, this.strings.GetString("DdsFileFormat_B5G6R5")); formatPCI.SetValueDisplayName(DdsFileFormat.B8G8R8, this.strings.GetString("DdsFileFormat_B8G8R8")); formatPCI.SetValueDisplayName(DdsFileFormat.R8Unsigned, this.strings.GetString("DdsFileFormat_R8Unsigned")); formatPCI.SetValueDisplayName(DdsFileFormat.R8G8Unsigned, this.strings.GetString("DdsFileFormat_R8G8Unsigned")); formatPCI.SetValueDisplayName(DdsFileFormat.R8G8Signed, this.strings.GetString("DdsFileFormat_R8G8Signed")); PropertyControlInfo compresionModePCI = configUI.FindControlForPropertyName(PropertyNames.BC7CompressionSpeed); compresionModePCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = this.strings.GetString("BC7CompressionSpeed_DisplayName"); compresionModePCI.SetValueDisplayName(BC7CompressionSpeed.Fast, this.strings.GetString("BC7CompressionSpeed_Fast")); compresionModePCI.SetValueDisplayName(BC7CompressionSpeed.Medium, this.strings.GetString("BC7CompressionSpeed_Medium")); compresionModePCI.SetValueDisplayName(BC7CompressionSpeed.Slow, this.strings.GetString("BC7CompressionSpeed_Slow")); PropertyControlInfo errorMetricPCI = configUI.FindControlForPropertyName(PropertyNames.ErrorMetric); errorMetricPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = this.strings.GetString("ErrorMetric_DisplayName"); errorMetricPCI.ControlType.Value = PropertyControlType.RadioButton; errorMetricPCI.SetValueDisplayName(DdsErrorMetric.Perceptual, this.strings.GetString("ErrorMetric_Perceptual")); errorMetricPCI.SetValueDisplayName(DdsErrorMetric.Uniform, this.strings.GetString("ErrorMetric_Uniform")); PropertyControlInfo cubemapPCI = configUI.FindControlForPropertyName(PropertyNames.CubeMap); cubemapPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; cubemapPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = this.strings.GetString("CubeMap_Description"); PropertyControlInfo generateMipPCI = configUI.FindControlForPropertyName(PropertyNames.GenerateMipMaps); generateMipPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; generateMipPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = this.strings.GetString("GenerateMipMaps_Description"); PropertyControlInfo mipResamplingPCI = configUI.FindControlForPropertyName(PropertyNames.MipMapResamplingAlgorithm); mipResamplingPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; mipResamplingPCI.SetValueDisplayName(ResamplingAlgorithm.NearestNeighbor, this.strings.GetString("ResamplingAlgorithm_NearestNeighbor")); mipResamplingPCI.SetValueDisplayName(ResamplingAlgorithm.Bicubic, this.strings.GetString("ResamplingAlgorithm_Bicubic")); mipResamplingPCI.SetValueDisplayName(ResamplingAlgorithm.Bilinear, this.strings.GetString("ResamplingAlgorithm_Bilinear")); mipResamplingPCI.SetValueDisplayName(ResamplingAlgorithm.Fant, this.strings.GetString("ResamplingAlgorithm_Fant")); mipResamplingPCI.SetValueDisplayName(ResamplingAlgorithm.SuperSampling, this.strings.GetString("ResamplingAlgorithm_SuperSampling")); PropertyControlInfo forumLinkPCI = configUI.FindControlForPropertyName(PropertyNames.ForumLink); forumLinkPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = this.strings.GetString("ForumLink_DisplayName"); forumLinkPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = this.strings.GetString("ForumLink_Description"); PropertyControlInfo githubLinkPCI = configUI.FindControlForPropertyName(PropertyNames.GitHubLink); githubLinkPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty; githubLinkPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = "GitHub"; // GitHub is a brand name that should not be localized. return(configUI); }
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); }