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); }
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); }
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); } }