AddButton() public method

public AddButton ( ) : CommandBarButton
return CommandBarButton
コード例 #1
0
 private static void AddControl(CommandBarControls parentControls, XmlNode xmlNode, GetImageDelegate getImage)
 {
     if (xmlNode.Name == "popup")
     {
         string          controlName = xmlNode.Attributes["caption"].Value;
         object          before      = ReadControlBeforeAttribute(xmlNode);
         CommandBarPopup newPopup    = parentControls.AddPopup(controlName, before);
         ApplyControlAttributes(newPopup, xmlNode, getImage);
         AddControls(newPopup.Controls, xmlNode.ChildNodes, getImage);
     }
     else if (xmlNode.Name == "button")
     {
         object           before    = ReadControlBeforeAttribute(xmlNode);
         CommandBarButton newButton = parentControls.AddButton(before);
         ApplyControlAttributes(newButton, xmlNode, getImage);
     }
 }
コード例 #2
0
ファイル: ExcelCommandBars.cs プロジェクト: Ryknyk/ExcelDna
 private static void AddControl(CommandBarControls parentControls, XmlNode xmlNode, GetImageDelegate getImage)
 {
     if (xmlNode.Name == "popup")
     {
         string controlName = xmlNode.Attributes["caption"].Value;
         object before = ReadControlBeforeAttribute(xmlNode);
         CommandBarPopup newPopup = parentControls.AddPopup(controlName, before);
         ApplyControlAttributes(newPopup, xmlNode, getImage);
         AddControls(newPopup.Controls, xmlNode.ChildNodes, getImage);
     }
     else if (xmlNode.Name == "button")
     {
         object before = ReadControlBeforeAttribute(xmlNode);
         CommandBarButton newButton = parentControls.AddButton(before);
         ApplyControlAttributes(newButton, xmlNode, getImage);
     }
 }