private static void ApplyToolFlashLocalization(ToolBase tool, LocalizationSettings localizationSettings) { GuardNotNull(tool, nameof(tool)); GuardNotNull(localizationSettings, nameof(localizationSettings)); var toolFlash = tool as ToolFlash; if (toolFlash == null) { return; } toolFlash.PopupContents.TitleText = localizationSettings.Texts[LocalizedTextId.TOOL_FLASH_TITLE].Value; toolFlash.PopupContents.ContentText = toolFlash .PopupContents .ContentText .Replace(GeneralPlaceholder, localizationSettings.Texts[LocalizedTextId.CAT_GENERAL].Value) .Replace(FlashFilePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_FLASH_FILE].Value) .Replace(SpecifyClassIdPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_SPECIFY_CLASS_ID].Value) .Replace(ClassIdPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_CLASS_ID].Value) .Replace(FlashVersionPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_FLASH_VERSION].Value) .Replace(DispositionPlaceholder, localizationSettings.Texts[LocalizedTextId.CAT_DISPOSITION].Value) .Replace(AlignmentPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_ALIGNMENT].Value) .Replace(FlashAlignmentPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_FLASH_ALIGNMENT].Value) .Replace(SizePlaceholder, localizationSettings.Texts[LocalizedTextId.CAT_SIZE].Value) .Replace(SpecifySizePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_SPECIFY_SIZE].Value) .Replace(WidthPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_WIDTH].Value) .Replace(HeightPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_HEIGHT].Value) .Replace(InPixelsPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_IN_PIXELS].Value) .Replace(InPercentPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_IN_PERCENT].Value) .Replace(OptionsPlaceholder, localizationSettings.Texts[LocalizedTextId.CAT_OPTIONS].Value) .Replace(QualityPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_QUALITY].Value) .Replace(LoopPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_LOOP].Value) .Replace(AutoPlayPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_AUTO_PLAY].Value) .Replace(YesPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_YES].Value) .Replace(NoPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_NO].Value) .Replace(OkPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_OK].Value) .Replace(CancelPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_CANCEL].Value) .Replace(AbsBottomPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_ABSBOTTOM].Value) .Replace(AbsMiddlePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_ABSMIDDLE].Value) .Replace(BaselinePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_BASELINE].Value) .Replace(BottomPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_BOTTOM].Value) .Replace(LeftPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_LEFT].Value) .Replace(MiddlePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_MIDDLE].Value) .Replace(RightPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_RIGHT].Value) .Replace(TextTopPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_TEXTTOP].Value) .Replace(TopPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_TOP].Value) .Replace(CenterTopPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_CENTER_TOP].Value) .Replace(CenterCenterPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_CENTER_CENTER].Value) .Replace(CenterBottomPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_CENTER_BOTTOM].Value) .Replace(LeftTopPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_LEFT_TOP].Value) .Replace(LeftCenterPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_LEFT_CENTER].Value) .Replace(LeftBottomPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_LEFT_BOTTOM].Value) .Replace(RightTopPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_RIGHT_TOP].Value) .Replace(RightCenterPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_RIGHT_CENTER].Value) .Replace(RightBottomPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_RIGHT_BOTTOM].Value) .Replace(LowPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_LOW].Value) .Replace(MediumPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_MEDIUM].Value) .Replace(HighPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_HIGH].Value); }
private static void ApplyToolLinkLocalization(ToolBase tool, LocalizationSettings localizationSettings) { GuardNotNull(tool, nameof(tool)); GuardNotNull(localizationSettings, nameof(localizationSettings)); var toolLink = tool as ToolLink; if (toolLink == null) { return; } toolLink.PopupContents.TitleText = localizationSettings.Texts[LocalizedTextId.TOOL_LINK_TITLE].Value; toolLink.PopupContents.ContentText = toolLink .PopupContents .ContentText .Replace(AddressPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_ADDRESS].Value) .Replace(TextPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_TEXT].Value) .Replace(AnchorsPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_ANCHOR].Value) .Replace(TargetPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_TARGET].Value) .Replace(TooltipPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_TOOLTIP].Value) .Replace(AltTextPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_ALT_TEXT].Value) .Replace(RemoveLinkPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_REMOVE_LINK].Value) .Replace(InsertLinkPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_INSERT_LINK].Value); }
private static void ApplyToolReplaceLocalization(ToolBase tool, LocalizationSettings localizationSettings) { GuardNotNull(tool, nameof(tool)); GuardNotNull(localizationSettings, nameof(localizationSettings)); var toolReplace = tool as ToolReplace; if (toolReplace == null) { return; } toolReplace.PopupContents.TitleText = localizationSettings.Texts[LocalizedTextId.TOOL_REPLACE_TITLE].Value; toolReplace.PopupContents.ContentText = toolReplace .PopupContents .ContentText .Replace(OldValuePlaceholder, localizationSettings.Texts[LocalizedTextId.TOOL_FIND_LABEL].Value) .Replace(ReplacePlaceholder, localizationSettings.Texts[LocalizedTextId.TOOL_REPLACE_LABEL].Value) .Replace(CaseSensitivePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_CASE_SENSITIVE].Value) .Replace(WholeWordPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_WHOLE_WORD].Value) .Replace(ReplaceAllPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_REPLACE_ALL].Value) .Replace(ReplaceButtonPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_REPLACE].Value) .Replace(NextPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_NEXT].Value) .Replace(CancelPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_CANCEL].Value); }
private static void ApplySpellcheckerLocalization(ToolBase tool, LocalizationSettings localizationSettings) { GuardNotNull(tool, nameof(tool)); GuardNotNull(localizationSettings, nameof(localizationSettings)); var toolSpellChecker = tool as ToolSpellChecker; if (toolSpellChecker == null) { return; } toolSpellChecker.PopupContents.TitleText = localizationSettings.Texts[LocalizedTextId.TOOL_SPELL_CHECKER_TITLE].Value; toolSpellChecker.PopupContents.ContentText = toolSpellChecker .PopupContents .ContentText .Replace(NotInDictionaryPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_NOT_IN_DICTIONARY].Value) .Replace(ChangeToPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_CHANGE_TO].Value) .Replace(SuggestionPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_SUGGESTION].Value) .Replace(ButtonIgnorePlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_IGNORE].Value) .Replace(ButtonIgnoreAllPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_IGNORE_ALL].Value) .Replace(ButtonReplacePlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_REPLACE].Value) .Replace(ButtonReplaceAllPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_REPLACE_ALL].Value) .Replace(ButtonClosePlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_CLOSE].Value); }
/// <summary> /// Determines the index of a specific <see cref="ToolBase"/> in the current instance. /// </summary> /// <param name="item">The <see cref="ToolBase"/> to locate in the current instance.</param> /// <returns>The index of value if found in the current instance; otherwise, -1.</returns> public int IndexOf(ToolBase item) { if (item == null) { throw new ArgumentNullException("item"); } return(_tools.IndexOf(item)); }
/// <summary> /// Determines whether a <see cref="ToolBase"/> is in the collection. /// </summary> /// <param name="item">The <see cref="ToolBase"/> to locate in the collection. The element to locate can be a null reference.</param> /// <returns>true if value is found in the collection; otherwise, false.</returns> public bool Contains(ToolBase item) { if (item == null) { return(false); } return(_tools.Contains(item)); }
/// <summary> /// Adds a <see cref="ToolBase"/> to the collection. /// </summary> /// <param name="item">The <see cref="ToolBase"/> to add to the collection.</param> /// <returns>The position into which the new element was inserted.</returns> public int Add(ToolBase item) { if (item == null) { throw new ArgumentNullException("item"); } _controls.Add(item); return(_tools.Add(item)); }
/// <summary> /// Inserts a <see cref="ToolBase"/> to the collection at the specified position. /// </summary> /// <param name="index">The zero-based index at which value should be inserted.</param> /// <param name="item">The <see cref="ToolBase"/> to insert into the Collection.</param> public void Insert(int index, ToolBase item) { if (item == null) { throw new ArgumentNullException("item"); } _tools.Insert(index, item); }
/// <summary> /// Removes the first occurrence of a specific <see cref="ToolBase"/> from the collection. /// </summary> /// <param name="item">The <see cref="ToolBase"/> to remove from the collection.</param> public void Remove(ToolBase item) { if (item == null) { throw new ArgumentNullException("item"); } int index = IndexOf(item); if (index >= 0) { RemoveAt(index); } _controls.Remove(item); }
private static void ApplyToolImageLocalization(ToolBase tool, LocalizationSettings localizationSettings) { GuardNotNull(tool, nameof(tool)); GuardNotNull(localizationSettings, nameof(localizationSettings)); var toolImage = tool as ToolImage; if (toolImage == null) { return; } toolImage.PopupContents.TitleText = localizationSettings.Texts[LocalizedTextId.TOOL_IMAGE_TITLE].Value; toolImage.PopupContents.ContentText = toolImage .PopupContents .ContentText .Replace(GeneralPlaceholder, localizationSettings.Texts[LocalizedTextId.CAT_GENERAL].Value) .Replace(PicturePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_PICTURE].Value) .Replace(TextPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_TEXT].Value) .Replace(DispositionPlaceholder, localizationSettings.Texts[LocalizedTextId.CAT_DISPOSITION].Value) .Replace(AlignmentPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_ALIGNMENT].Value) .Replace(HorizontalSpacingPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_HORIZONTAL_SPACING].Value) .Replace(VerticalSpacingPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_VERTICAL_SPACING].Value) .Replace(BorderThicknessPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_BORDER_THICKNESS].Value) .Replace(SizePlaceholder, localizationSettings.Texts[LocalizedTextId.CAT_SIZE].Value) .Replace(SpecifySizePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_SPECIFY_SIZE].Value) .Replace(WidthPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_WIDTH].Value) .Replace(HeightPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_HEIGHT].Value) .Replace(InPixelsPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_IN_PIXELS].Value) .Replace(InPercentPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_IN_PERCENT].Value) .Replace(KeepAspectRatioPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_KEEP_ASPECT_RATIO].Value) .Replace(StylePlaceholder, localizationSettings.Texts[LocalizedTextId.CAT_STYLE].Value) .Replace(CssClassPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_CSS_CLASS].Value) .Replace(OkPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_OK].Value) .Replace(CancelPlaceholder, localizationSettings.Texts[LocalizedTextId.BUTTON_CANCEL].Value) .Replace(DefaultPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_DEFAULT].Value) .Replace(AbsBottomPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_ABSBOTTOM].Value) .Replace(AbsMiddlePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_ABSMIDDLE].Value) .Replace(BaselinePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_BASELINE].Value) .Replace(BottomPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_BOTTOM].Value) .Replace(LeftPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_LEFT].Value) .Replace(MiddlePlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_MIDDLE].Value) .Replace(RightPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_RIGHT].Value) .Replace(TextTopPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_TEXTTOP].Value) .Replace(TopPlaceholder, localizationSettings.Texts[LocalizedTextId.LABEL_TOP].Value); }