internal static void CicleControls(String formName, Control.ControlCollection controls, String culture) { foreach (Control control in controls) { try { Type controlType = control.GetType(); if (controlType == typeof(TextBox) || controlType == typeof(Label) || controlType == typeof(LinkLabel) || controlType == typeof(Button) || controlType == typeof(CheckBox) || controlType == typeof(RadioButton) || controlType == typeof(RichTextBox) || controlType == typeof(TabControl)) { GeneralControl.ManageControl(control, formName, culture); } else if (controlType == typeof(TabPage)) { TabPageControl.ManageControl(control, formName, culture); } else if (controlType == typeof(FlowLayoutPanel) || controlType == typeof(Panel) || controlType == typeof(SplitContainer) || controlType == typeof(SplitterPanel) || controlType == typeof(ContextMenuStrip)) { PanelMenuControl.ManageControl(control, formName, culture); } else if (controlType == typeof(GroupBox)) { GroupBoxControl.ManageControl(control, formName, culture); } else if (controlType == typeof(MenuStrip)) { MenuStripControl.ManageControl(control, formName, culture); } else if (controlType == typeof(ToolStrip)) { ToolStripControl.ManageControl(control, formName, culture); } else if (controlType == typeof(StatusStrip)) { StatusStripControl.ManageControl(control, formName, culture); } else if (controlType == typeof(ComboBox)) { ComboBoxControl.ManageControl(control, formName, culture); } else if (controlType == typeof(TreeView)) { TreeViewControl.ManageControl(control, formName, culture); } } catch (Exception exception) { throw new LanguageException(String.Format("{0} - {1}", control.Name, exception.Message)); } } }
public VideoBrowserForm(ArrayList videoSources, string blogID, int selectedTab) { // // Required for Windows Form Designer support // InitializeComponent(); _videoSources = videoSources; //set strings btnInsert.Text = Res.Get(StringId.InsertButtonText); btnCancel.Text = Res.Get(StringId.CancelButton); Text = Res.Get(StringId.Plugin_Videos_Select_Video_Form); if (!MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.VideoCopyright)) { copyrightLinkLabel.Visible = false; } else { copyrightLinkLabel.Font = Res.GetFont(FontSize.Small, FontStyle.Regular); copyrightLinkLabel.Text = Res.Get(StringId.Plugin_Video_Copyright_Notice); string link = MarketizationOptions.GetFeatureParameter(MarketizationOptions.Feature.VideoCopyright, "Glink"); if (link == null || link == String.Empty) { copyrightLinkLabel.LinkArea = new LinkArea(0, 0); } else { copyrightLinkLabel.LinkClicked += copyrightLinkLabel_LinkClicked; } } copyrightLinkLabel.LinkColor = SystemColors.HotTrack; // // tabs // tabs = new TabLightweightControl(); tabs.VirtualBounds = new Rectangle(0, 5, 450, 485); tabs.LightweightControlContainerControl = mainTabControl; tabs.DrawSideAndBottomTabPageBorders = false; tabs.ColorizeBorder = false; int i = 0; foreach (VideoSource videoSource in _videoSources) { videoSource.BlogId = blogID; videoSource.Init(); videoSource.VideoSelected += new EventHandler(videoSource_VideoSelected); TabPageControl tab = (TabPageControl)videoSource; tab.TabStop = false; Controls.Add(tab); tabs.SetTab(i++, tab); } // initial appearance of editor SetActiveTab(selectedTab); tabs.SelectedTabNumber = selectedTab; tabs.SelectedTabNumberChanged += new EventHandler(tabs_SelectedTabNumberChanged); if (!DesignMode) { Icon = ApplicationEnvironment.ProductIcon; } tabs.VirtualLocation = new Point(0, 5); tabs.VirtualSize = Size; Width = 510; Height = 570; }
public MediaInsertForm(List <MediaTab> sources, string blogID, int selectedTab, MediaSmartContent content, string title, bool showCopyright, bool isEdit) { // // Required for Windows Form Designer support // InitializeComponent(); _sources = sources; //set strings btnCancel.Text = Res.Get(StringId.CancelButton); if (!isEdit) { buttonInsert.Text = Res.Get(StringId.InsertButtonText); } else { buttonInsert.Text = Res.Get(StringId.OKButtonText); } Text = title; if (!showCopyright || !MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.VideoCopyright)) { copyrightLinkLabel.Visible = false; } else { copyrightLinkLabel.Font = Res.GetFont(FontSize.Small, FontStyle.Regular); copyrightLinkLabel.Text = Res.Get(StringId.Plugin_Video_Copyright_Notice); string link = MarketizationOptions.GetFeatureParameter(MarketizationOptions.Feature.VideoCopyright, "Glink"); if (link == null || link == String.Empty) { copyrightLinkLabel.LinkArea = new LinkArea(0, 0); } else { copyrightLinkLabel.LinkClicked += copyrightLinkLabel_LinkClicked; } } copyrightLinkLabel.LinkColor = SystemColors.HotTrack; // // tabs // tabs = new TabLightweightControl(); tabs.VirtualBounds = new Rectangle(0, 5, 450, 485); tabs.LightweightControlContainerControl = mainTabControl; tabs.DrawSideAndBottomTabPageBorders = false; tabs.ColorizeBorder = false; int i = 0; foreach (MediaTab mediaSource in _sources) { mediaSource.MediaSelected += videoSource_MediaSelected; TabPageControl tab = mediaSource; tab.TabStop = false; Controls.Add(tab); tabs.SetTab(i++, tab); } // initial appearance of editor if (!DesignMode) { Icon = ApplicationEnvironment.ProductIcon; } tabs.VirtualLocation = new Point(0, 5); tabs.VirtualSize = Size; Width = 510; Height = 570; foreach (MediaTab videoSource in _sources) { videoSource.Init(content, blogID); } SetActiveTab(selectedTab); tabs.SelectedTabNumber = selectedTab; tabs.SelectedTabNumberChanged += new EventHandler(tabs_SelectedTabNumberChanged); Closing += new CancelEventHandler(MediaInsertForm_Closing); }
internal static void CicleControls(String formName, Control.ControlCollection controls, bool isFormReloading) { foreach (Control control in controls) { if (control.Tag != null && control.Tag.ToString() == ConstantUtil.dontTranslate) { continue; } try { Type controlType = control.GetType(); if (controlType == typeof(TextBox) || controlType == typeof(Label) || controlType == typeof(LinkLabel) || controlType == typeof(Button) || controlType == typeof(CheckBox) || controlType == typeof(CustomCheckBox) || controlType == typeof(RadioButton) || controlType == typeof(RichTextBox) || (controlType == typeof(CustomXtraTabControl) && !isFormReloading) || controlType == typeof(TabControl) || controlType == typeof(XtraTabControl) || controlType == typeof(XmlGridView) || controlType == typeof(DataGridView)) { GeneralControl.ManageControl(control, formName, isFormReloading); } else if (controlType == typeof(TabPage)) { TabPageControl.ManageControl(control, formName, isFormReloading); } else if (controlType == typeof(XtraTabPage)) { XtraTabPageControl.ManageControl(control, formName, isFormReloading); } else if (controlType == typeof(FlowLayoutPanel) || controlType == typeof(Panel) || controlType == typeof(SplitContainer) || controlType == typeof(SplitterPanel) || controlType == typeof(ContextMenuStrip)) { PanelMenuControl.ManageControl(control, formName, isFormReloading); } else if (controlType == typeof(GroupBox)) { GroupBoxControl.ManageControl(control, formName, isFormReloading); } else if (controlType == typeof(MenuStrip)) { MenuStripControl.ManageControl(control, formName); } else if (controlType == typeof(ToolStrip)) { ToolStripControl.ManageControl(control, formName); } else if (controlType == typeof(StatusStrip)) { StatusStripControl.ManageControl(control, formName); } else if (controlType == typeof(ComboBox) || (controlType == typeof(ComboBoxEdit))) { ComboBoxControl.ManageControl(control, formName); } else if (controlType == typeof(CustomComboBox)) { CustomComboBoxControl.ManageControl(control, formName); } else if (controlType == typeof(CustomNumericUpDown)) { CustomNumericUpDownControl.ManageControl(control, formName); } else if (controlType == typeof(TreeView)) { TreeViewControl.ManageControl(control, formName); } else if (controlType == typeof(ListView)) { ListViewControl.ManageControl(control, formName); } } catch (Exception exception) { throw new LanguageException(String.Format("{0} - {1}", control.Name, exception.Message), exception); } } }