コード例 #1
0
        public void OnDisplayMenu(string MenuTitle, AgEUiPluginMenuBarKind MenuBarKind, IAgUiPluginMenuBuilder2 MenuBuilder)
        {
            stdole.IPictureDisp picture;
            Assembly            currentAssembly = Assembly.GetExecutingAssembly();
            Image icon = Image.FromStream(currentAssembly.GetManifestResourceStream(m_imageResource));

            picture = OlePictureHelper.OlePictureFromImage(icon);
        }
コード例 #2
0
        public void OnInitializeToolbar(IAgUiPluginToolbarBuilder ToolbarBuilder)
        {
            //converting an ico file to be used as the image for toolbar button
            stdole.IPictureDisp picture;
            Assembly            currentAssembly = Assembly.GetExecutingAssembly();
            Image icon = Image.FromStream(currentAssembly.GetManifestResourceStream(m_imageResource));

            picture = OlePictureHelper.OlePictureFromImage(icon);
            //Add a Toolbar Button
            ToolbarBuilder.AddButton(m_commandText, m_pluginTitle, m_pluginDescription, AgEToolBarButtonOptions.eToolBarButtonOptionAlwaysOn, picture);
        }
コード例 #3
0
 public void OnDisplayContextMenu(IAgUiPluginMenuBuilder MenuBuilder)
 {
     if (m_integrate)
     {
         stdole.IPictureDisp picture;
         Assembly            currentAssembly = Assembly.GetExecutingAssembly();
         Image icon = Image.FromStream(currentAssembly.GetManifestResourceStream(m_imageResource));
         picture = OlePictureHelper.OlePictureFromImage(icon);
         //Add a Menu Item
         MenuBuilder.AddMenuItem(m_commandText, m_pluginTitle, m_pluginDescription, picture);
     }
 }