protected override void OnClick(DesignerRegionMouseEventArgs e) { // is it a tab? if (e.Region != null && e.Region.Name.StartsWith("t", StringComparison.Ordinal)) { CurrentTabID = e.Region.Name.Substring(1); } else if (e.Region != null && e.Region.Name == AddTabName) { // is it the "AddNewTab" region? OnAddTabPanel(); } base.OnClick(e); }
protected override void OnClick(System.Web.UI.Design.DesignerRegionMouseEventArgs e) { base.OnClick(e); }
/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnClick(DesignerRegionMouseEventArgs e) { if (e == null || e.Region == null) { return; } PanelClickAction action = (PanelClickAction)Enum.Parse(typeof(PanelClickAction), e.Region.Name); switch(action) { case PanelClickAction.Toggle: TogglePanel(); break; default: throw new ArgumentOutOfRangeException(); } }
protected override void OnClick(DesignerRegionMouseEventArgs e) { WindowClickAction action = (WindowClickAction)Enum.Parse(typeof(WindowClickAction), e.Region.Name); switch (action) { case WindowClickAction.Toggle: ToggleWindow(); break; default: throw new ArgumentOutOfRangeException(); } }
protected override void OnClick(DesignerRegionMouseEventArgs e) { if (e.Region != null) { this.SelectedFieldIndex = (int) e.Region.UserData; this.UpdateDesignTimeHtml(); } }
/// <summary> /// Called by the design host when the user clicks the associated control at design time. /// </summary> /// <param name="e">A <see cref="T:System.Web.UI.Design.DesignerRegionMouseEventArgs"></see> that specifies the location and, possibly, the control designer region that the user clicked.</param> protected override void OnClick(DesignerRegionMouseEventArgs e) { if (e.Region == null) return; Grid grid = (Grid)Component; // If the clicked region is not a header, return if (e.Region.Name.IndexOf(HeaderPrefix) != 0) return; // Switch the current view if required //only when the clicked region is different than the active region. if (e.Region.Name.Substring(HeaderPrefix.Length) == grid.CurrentDesignColumn.ToString()) return; //extract the index of the design region, and set the CurrentDesignTab index grid.CurrentDesignColumn = int.Parse(e.Region.Name.Substring(HeaderPrefix.Length)); //then after update the design time HTML base.UpdateDesignTimeHtml(); }
protected override void OnClick(DesignerRegionMouseEventArgs e) { if (e.Region == null) return; if (e.Region.Name.IndexOf(HEADER_PREFIX) != 0) return; if (e.Region.Name.Substring(HEADER_PREFIX.Length) != tabControl.CurrentDesignTab.ToString()) { tabControl.CurrentDesignTab = int.Parse(e.Region.Name.Substring(HEADER_PREFIX.Length)); base.UpdateDesignTimeHtml(); } }
protected override void OnClick(DesignerRegionMouseEventArgs e) { if (e.Region == null) { return; } string[] parameters = e.Region.Name.Split('_'); TabPanelClickAction action = (TabPanelClickAction)Enum.Parse(typeof(TabPanelClickAction), parameters[0]); switch (action) { case TabPanelClickAction.ChangeTab: int tabId = int.Parse(parameters[1]); if (this.tabPanelControl.ActiveTabIndex != tabId) { PropertyDescriptor activeTab = TypeDescriptor.GetProperties(this.tabPanelControl)["ActiveTabIndex"]; activeTab.SetValue(this.tabPanelControl, tabId); this.tabPanelControl.ActiveTabIndex = tabId; } break; case TabPanelClickAction.AddTab: AddTabAtEnd(); break; default: throw new ArgumentOutOfRangeException(); } this.Tag.SetDirty(true); this.UpdateDesignTimeHtml(); base.OnClick(e); }
protected override void OnClick(DesignerRegionMouseEventArgs e) { base.OnClick(e); //make sure that we click on header. if (e.Region.Name.IndexOf("Header") == -1) return; if (e.Region != null) { currentTabIndex = tabView.CurrentTabIndex = int.Parse(e.Region.Name.Substring("Header".Length)); base.UpdateDesignTimeHtml(); } }
protected virtual void OnClick(DesignerRegionMouseEventArgs e) { }
protected override void OnClick(DesignerRegionMouseEventArgs e) { if (e.Region == null) { return; } // 点击的不是Tab标签 if (!e.Region.Name.StartsWith("Tab_")) { return; } int regionTabIndex = Convert.ToInt32(e.Region.Properties["TabIndex"]); // 如果当前不是激活的Tab if (regionTabIndex != CurrentControl.ActiveTabIndex) { CurrentControl.ActiveTabIndex = regionTabIndex; UpdateDesignTimeHtml(); } }
protected override void OnClick(DesignerRegionMouseEventArgs e) { if (e.Region == null) return; if (e.Region.Name == "Header0" && _currentView != 0) { _currentView = 0; UpdateDesignTimeHtml(); } if (e.Region.Name == "Header1" && _currentView != 1) { _currentView = 1; UpdateDesignTimeHtml(); } }
protected override void OnClick(DesignerRegionMouseEventArgs e) { string[] parameters = e.Region.Name.Split('_'); string actionName = parameters[0]; FitLayoutClickAction action = (FitLayoutClickAction) Enum.Parse(typeof (FitLayoutClickAction), actionName); switch (action) { case FitLayoutClickAction.AddPanel: AddItem(typeof (Panel)); break; case FitLayoutClickAction.AddTabPanel: AddItem(typeof (TabPanel)); break; case FitLayoutClickAction.Toggle: Panel panel = this.fitLayout.Items[0] as Panel; PropertyDescriptor collapsed = TypeDescriptor.GetProperties(panel)["Collapsed"]; bool value = (bool)collapsed.GetValue(panel); collapsed.SetValue(panel, !value); panel.Collapsed = !value; Tag.SetDirty(true); this.UpdateDesignTimeHtml(); break; case FitLayoutClickAction.ChangeTab: if (parameters.Length < 2) { return; } int tabId = int.Parse(parameters[1]); if (this.fitLayout.Items.Count == 0) { return; } TabPanel tabPanel = this.fitLayout.Items[0] as TabPanel; if (tabPanel == null) { return; } if (tabPanel.ActiveTabIndex != tabId) { IComponentChangeService changeService = (IComponentChangeService) GetService(typeof (IComponentChangeService)); try { changeService.OnComponentChanging(this.fitLayout, TypeDescriptor.GetProperties(this.fitLayout)["Items"]); PropertyDescriptor activeTab = TypeDescriptor.GetProperties(tabPanel)["ActiveTabIndex"]; activeTab.SetValue(tabPanel, tabId); tabPanel.ActiveTabIndex = tabId; } finally { changeService.OnComponentChanged(this.fitLayout, TypeDescriptor.GetProperties(this.fitLayout)["Items"], null, null); } Tag.SetDirty(true); this.UpdateDesignTimeHtml(); } break; default: throw new ArgumentOutOfRangeException(); } }
protected override void OnClick(DesignerRegionMouseEventArgs e) { string actionName = e.Region.Name; ViewportClickAction action = (ViewportClickAction)Enum.Parse(typeof(ViewportClickAction), actionName); switch(action) { case ViewportClickAction.AddBorderLayout: AddBorderLayout(); break; case ViewportClickAction.AddFitLayout: AddFitLayout(); break; case ViewportClickAction.AddAccordion: AddAccordion(); break; default: throw new ArgumentOutOfRangeException(); } }
protected virtual void OnClick (DesignerRegionMouseEventArgs e) { throw new NotImplementedException (); }
protected override void OnClick(DesignerRegionMouseEventArgs e) { base.OnClick(e); IDesignerHost service = (IDesignerHost) this.GetService(typeof(IDesignerHost)); WizardSelectableRegion region = e.Region as WizardSelectableRegion; if (region != null) { PropertyDescriptor descriptor = TypeDescriptor.GetProperties(this._wizard)["ActiveStepIndex"]; int index = this._wizard.WizardSteps.IndexOf(region.Step); if (this.ActiveStepIndex != index) { using (DesignerTransaction transaction = service.CreateTransaction("Update ActiveStepIndex")) { descriptor.SetValue(base.Component, index); transaction.Commit(); } } } }
/// <summary> /// OnClick /// </summary> /// <param name="e"></param> /// <remarks> /// OnClick /// </remarks> protected override void OnClick(DesignerRegionMouseEventArgs e) { base.OnClick(e); this.currentRegion = -1; if (e.Region != null) { for (int i = 0; i < this.nbRegions; i++) { if (e.Region.Name == i.ToString()) { this.currentRegion = i; break; } } UpdateDesignTimeHtml(); } }
protected override void OnClick(DesignerRegionMouseEventArgs e) { if (e.Region == null) { return; } string[] parameters = e.Region.Name.Split('_'); if (parameters.Length < 2) { return; } BorderLayoutRegion region = GetLayoutRegionByName(parameters[0]); if (region == null) { return; } BorderLayoutClickAction action = (BorderLayoutClickAction)Enum.Parse(typeof(BorderLayoutClickAction), parameters[1]); switch (action) { case BorderLayoutClickAction.AddPanel: this.AddPanel(region); break; case BorderLayoutClickAction.AddTabPanel: this.AddTabPanel(region); break; case BorderLayoutClickAction.ClearRegion: this.ClearRegion(region.Region); break; case BorderLayoutClickAction.TurnOffScheme: TypeDescriptor.GetProperties(this.layout)["SchemeMode"].SetValue(this.layout, false); //this.Refresh(); break; case BorderLayoutClickAction.ChangeTab: int tabId = int.Parse(parameters[2]); if (region.Items.Count == 0) { return; } TabPanel tabPanel = region.Items[0] as TabPanel; if (tabPanel == null) { return; } if (tabPanel.ActiveTabIndex != tabId) { PropertyDescriptor activeTab = TypeDescriptor.GetProperties(tabPanel)["ActiveTabIndex"]; activeTab.SetValue(tabPanel, tabId); tabPanel.ActiveTabIndex = tabId; } break; case BorderLayoutClickAction.ChangeToPanel: this.AddPanel(region); break; case BorderLayoutClickAction.ChangeToTabPanel: this.AddTabPanel(region); break; case BorderLayoutClickAction.Collapse: CollapsePanel(region, true); break; case BorderLayoutClickAction.Expand: CollapsePanel(region, false); break; default: throw new ArgumentOutOfRangeException(); } this.Tag.SetDirty(true); this.UpdateDesignTimeHtml(); //base.OnClick(e); }
protected virtual void OnClick(DesignerRegionMouseEventArgs e) { throw new NotImplementedException(); }
protected override void OnClick(DesignerRegionMouseEventArgs e) { if (e.Region == null) { return; } string[] parameters = e.Region.Name.Split('_'); if (parameters.Length < 2) { return; } switch (parameters[0]) { case "Toggle": Toggle(int.Parse(parameters[1])); break; default: throw new ArgumentOutOfRangeException(); } this.Tag.SetDirty(true); this.UpdateDesignTimeHtml(); }