コード例 #1
0
 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;
         }
     }
 }
コード例 #2
0
ファイル: HtmlSourceView.cs プロジェクト: ikvm/webmatrix
 public override bool SupportsToolboxSection(ToolboxSection section)
 {
     if (!base.SupportsToolboxSection(section))
     {
         return (section.GetType() == typeof(HtmlElementToolboxSection));
     }
     return true;
 }
コード例 #3
0
ファイル: AspNetSourceView.cs プロジェクト: ikvm/webmatrix
 public override bool SupportsToolboxSection(ToolboxSection section)
 {
     if (!base.SupportsToolboxSection(section))
     {
         return (section.GetType() == typeof(CodeWizardToolboxSection));
     }
     return true;
 }
コード例 #4
0
 public override bool SupportsToolboxSection(ToolboxSection section)
 {
     Type type = section.GetType();
     if ((type != typeof(MobileWebFormsToolboxSection)) && (type != typeof(SnippetToolboxSection)))
     {
         return (type == typeof(CustomControlsToolboxSection));
     }
     return true;
 }
コード例 #5
0
ファイル: WebFormsSourceView.cs プロジェクト: ikvm/webmatrix
 public override bool SupportsToolboxSection(ToolboxSection section)
 {
     Type type = section.GetType();
     if (!base.SupportsToolboxSection(section) && (type != typeof(WebFormsToolboxSection)))
     {
         return (type == typeof(CustomControlsToolboxSection));
     }
     return true;
 }
コード例 #6
0
 bool IToolboxClient.SupportsToolboxSection(ToolboxSection section)
 {
     return (((this._currentView != null) && (this._currentView.viewToolboxClient != null)) && this._currentView.viewToolboxClient.SupportsToolboxSection(section));
 }
コード例 #7
0
ファイル: HtmlDesignView.cs プロジェクト: ikvm/webmatrix
 bool IToolboxClient.SupportsToolboxSection(ToolboxSection section)
 {
     return this.SupportsToolboxSection(section);
 }
コード例 #8
0
ファイル: HtmlDesignView.cs プロジェクト: ikvm/webmatrix
 public virtual bool SupportsToolboxSection(ToolboxSection section)
 {
     Type type = section.GetType();
     if (type != typeof(HtmlElementToolboxSection))
     {
         return (type == typeof(SnippetToolboxSection));
     }
     return true;
 }
コード例 #9
0
 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;
 }
コード例 #10
0
ファイル: SourceView.cs プロジェクト: ikvm/webmatrix
 public virtual bool SupportsToolboxSection(ToolboxSection section)
 {
     return (section.GetType() == typeof(SnippetToolboxSection));
 }
コード例 #11
0
ファイル: ToolboxService.cs プロジェクト: ikvm/webmatrix
 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));
     }
 }
コード例 #12
0
ファイル: WebFormsDesignView.cs プロジェクト: ikvm/webmatrix
 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;
 }
コード例 #13
0
 public ToolboxSectionEventArgs(ToolboxSection section)
 {
     this._section = section;
 }
コード例 #14
0
ファイル: DocumentWindow.cs プロジェクト: ikvm/webmatrix
 bool IToolboxClient.SupportsToolboxSection(ToolboxSection section)
 {
     return ((this._viewToolboxClient != null) && this._viewToolboxClient.SupportsToolboxSection(section));
 }
コード例 #15
0
ファイル: ToolboxService.cs プロジェクト: ikvm/webmatrix
 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));
     }
 }
コード例 #16
0
ファイル: ToolboxToolWindow.cs プロジェクト: ikvm/webmatrix
 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);
 }
コード例 #17
0
ファイル: ToolboxToolWindow.cs プロジェクト: ikvm/webmatrix
 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;
         }
     }
 }
コード例 #18
0
ファイル: ToolboxToolWindow.cs プロジェクト: ikvm/webmatrix
 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;
             }
         }
     }
 }
コード例 #19
0
ファイル: ToolboxToolWindow.cs プロジェクト: ikvm/webmatrix
 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;
         }
     }
 }