private void ProcessToolboxSection(XmlNode configSection, ToolboxSection section) { foreach (XmlNode node in configSection.ChildNodes) { try { if ((node.NodeType != XmlNodeType.Whitespace) && (node.NodeType != XmlNodeType.Comment)) { if ((node.NodeType != XmlNodeType.Element) || !node.Name.Equals("toolboxItem")) { throw new ConfigurationException("Unexpected XML node type ", node); } XmlAttribute attribute = node.Attributes["data"]; if ((attribute == null) || (attribute.Value.Length == 0)) { throw new ConfigurationException("Missing required attribute 'data'", node); } try { ToolboxDataItem item = section.CreateToolboxDataItem(attribute.Value); section.AddToolboxDataItem(item); } catch { throw new ConfigurationException("Invalid toolboxItem", node); } } continue; } catch (Exception) { continue; } } }
public override bool SupportsToolboxSection(ToolboxSection section) { if (!base.SupportsToolboxSection(section)) { return (section.GetType() == typeof(HtmlElementToolboxSection)); } return true; }
public override bool SupportsToolboxSection(ToolboxSection section) { if (!base.SupportsToolboxSection(section)) { return (section.GetType() == typeof(CodeWizardToolboxSection)); } return true; }
public override bool SupportsToolboxSection(ToolboxSection section) { Type type = section.GetType(); if ((type != typeof(MobileWebFormsToolboxSection)) && (type != typeof(SnippetToolboxSection))) { return (type == typeof(CustomControlsToolboxSection)); } return true; }
public override bool SupportsToolboxSection(ToolboxSection section) { Type type = section.GetType(); if (!base.SupportsToolboxSection(section) && (type != typeof(WebFormsToolboxSection))) { return (type == typeof(CustomControlsToolboxSection)); } return true; }
bool IToolboxClient.SupportsToolboxSection(ToolboxSection section) { return (((this._currentView != null) && (this._currentView.viewToolboxClient != null)) && this._currentView.viewToolboxClient.SupportsToolboxSection(section)); }
bool IToolboxClient.SupportsToolboxSection(ToolboxSection section) { return this.SupportsToolboxSection(section); }
public virtual bool SupportsToolboxSection(ToolboxSection section) { Type type = section.GetType(); if (type != typeof(HtmlElementToolboxSection)) { return (type == typeof(SnippetToolboxSection)); } return true; }
public override bool SupportsToolboxSection(ToolboxSection section) { if (base.InTemplateMode) { if (!base.SupportsToolboxSection(section)) { return (section is MobileWebFormsToolboxSection); } return true; } Type type = section.GetType(); if ((type != typeof(MobileWebFormsToolboxSection)) && (type != typeof(SnippetToolboxSection))) { return (type == typeof(CustomControlsToolboxSection)); } return true; }
public virtual bool SupportsToolboxSection(ToolboxSection section) { return (section.GetType() == typeof(SnippetToolboxSection)); }
void IToolboxService.AddToolboxSection(ToolboxSection section) { if (section == null) { throw new ArgumentNullException("section"); } this._sections.Add(section); if (this._sectionAddedHandler != null) { this._sectionAddedHandler(this, new ToolboxSectionEventArgs(section)); } }
public override bool SupportsToolboxSection(ToolboxSection section) { if (this.InTemplateMode) { return ((IToolboxClient) this._templateEditingDialog.DesignView).SupportsToolboxSection(section); } if (!base.SupportsToolboxSection(section) && (section.GetType() != typeof(WebFormsToolboxSection))) { return (section.GetType() == typeof(CustomControlsToolboxSection)); } return true; }
public ToolboxSectionEventArgs(ToolboxSection section) { this._section = section; }
bool IToolboxClient.SupportsToolboxSection(ToolboxSection section) { return ((this._viewToolboxClient != null) && this._viewToolboxClient.SupportsToolboxSection(section)); }
void IToolboxService.RemoveToolboxSection(ToolboxSection section) { if (section == null) { throw new ArgumentNullException("section"); } int index = -1; for (int i = this._sections.Count - 1; i >= 0; i--) { if (this._sections[i] == section) { index = i; break; } } if (index == -1) { throw new ArgumentException("Unknown section"); } this._sections.RemoveAt(index); if (this._sectionRemovedHandler != null) { this._sectionRemovedHandler(this, new ToolboxSectionEventArgs(section)); } }
protected override void Dispose(bool disposing) { if (disposing) { IServiceContainer container = (IServiceContainer) this.GetService(typeof(IServiceContainer)); if (container != null) { container.RemoveService(typeof(IToolboxService)); } IToolboxService service = (IToolboxService) this.GetService(typeof(IToolboxService)); if (service != null) { service.SectionAdded -= new ToolboxSectionEventHandler(this.OnSectionAdded); service.SectionRemoved -= new ToolboxSectionEventHandler(this.OnSectionRemoved); service.ActiveSectionChanged -= new ToolboxSectionEventHandler(this.OnActiveSectionChanged); } this._activeDesigner = null; this._activeClient = null; this._currentSection = null; IDesignerEventService service2 = (IDesignerEventService) this.GetService(typeof(IDesignerEventService)); if (service2 != null) { service2.ActiveDesignerChanged -= new ActiveDesignerEventHandler(this.OnActiveDesignerChanged); } } base.Dispose(disposing); }
private void UpdateToolboxClient() { if (this._activeClient == null) { for (int i = 0; i < this._sections.Count; i++) { ((SectionInfo) this._sections[i]).UISection.Visible = false; } this.CurrentSection = null; } else { SectionInfo info = null; SectionInfo info2 = null; for (int j = 0; j < this._sections.Count; j++) { SectionInfo info3 = (SectionInfo) this._sections[j]; if (this._activeClient.SupportsToolboxSection(info3.ToolboxSection)) { if (info3.ToolboxSection == this._activeClient.DefaultToolboxSection) { info2 = info3; } if (info == null) { info = info3; } info3.UISection.Visible = true; } else { info3.UISection.Visible = false; } } if (info2 != null) { this.CurrentSection = info2.ToolboxSection; this._groupView.SelectedSection = info2.UISection; } else if (info != null) { this.CurrentSection = info.ToolboxSection; this._groupView.SelectedSection = info.UISection; } else { this.CurrentSection = null; } } }
private void OnGroupViewSelectedSectionChanged(object sender, EventArgs e) { GroupViewSection selectedSection = this._groupView.SelectedSection; if (selectedSection != null) { for (int i = 0; i < this._sections.Count; i++) { SectionInfo info = (SectionInfo) this._sections[i]; if (info.UISection == selectedSection) { this.CurrentSection = info.ToolboxSection; return; } } } }
private void OnActiveSectionChanged(object sender, ToolboxSectionEventArgs e) { if (!this._internalChange) { ToolboxSection section = e.Section; if (this.CurrentSection != section) { this.CurrentSection = section; SectionInfo info = null; foreach (SectionInfo info2 in this._sections) { if (info2.ToolboxSection == section) { info = info2; break; } } this._groupView.SelectedSection = info.UISection; } } }