Show / Hide Table of Contents

Class MenuResource

The MenuResource class provides methods to load and manipulate a menu resource that is used by CADability and its applications to compose the main menu, popup and context menues.

Inheritance
System.Object
MenuResource
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CADability.UserInterface
Assembly: CADability.dll
Syntax
public class MenuResource

Methods

| Improve this Doc View Source

AddMenuResource(Stream)

Adds all subnodes of "CustomMenus" to the standard menu resource (e.g. additional context menus).

Declaration
public static void AddMenuResource(Stream XmlStream)
Parameters
Type Name Description
System.IO.Stream XmlStream

Stream containing the XML document

| Improve this Doc View Source

CreateContextMenuWithHandler(String[], ICommandHandler)

Loads a MainMenu from the menu resource with the provided name. For the unmodified standard resource the menuname will be "SDI Menu"

Declaration
public static MenuWithHandler[] CreateContextMenuWithHandler(string[] menuIDs, ICommandHandler Handler)
Parameters
Type Name Description
System.String[] menuIDs
ICommandHandler Handler
Returns
Type Description
MenuWithHandler[]
| Improve this Doc View Source

FindImageIndex(String)

Declaration
public static int FindImageIndex(string MenuID)
Parameters
Type Name Description
System.String MenuID
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetPopupItems(String)

Declaration
public static string[] GetPopupItems(string MenuName)
Parameters
Type Name Description
System.String MenuName
Returns
Type Description
System.String[]
| Improve this Doc View Source

IsPopup(String)

Returns true if the provided name is a popup menu (context menu)

Declaration
public static bool IsPopup(string MenuName)
Parameters
Type Name Description
System.String MenuName
Returns
Type Description
System.Boolean
| Improve this Doc View Source

LoadMenuDefinition(String, Boolean, ICommandHandler)

Declaration
public static MenuWithHandler[] LoadMenuDefinition(string MenuName, bool main, ICommandHandler handler)
Parameters
Type Name Description
System.String MenuName
System.Boolean main
ICommandHandler handler
Returns
Type Description
MenuWithHandler[]
| Improve this Doc View Source

ReplaceMenus(Stream)

replaces all popup menus contained in subnodes of "CustomMenus" of the provided document.

Declaration
public static void ReplaceMenus(Stream XmlStream)
Parameters
Type Name Description
System.IO.Stream XmlStream

Stream containing the XML document

| Improve this Doc View Source

SetMenuResource(Stream)

Replaces the standard menu resource by the provided XML document

Declaration
public static void SetMenuResource(Stream XmlStream)
Parameters
Type Name Description
System.IO.Stream XmlStream

The document opend as a stream

| Improve this Doc View Source

SetMenuResource(XmlDocument)

Replaces the standard menu resource by the provided XML document

Declaration
public static void SetMenuResource(XmlDocument XmlMenuDocument)
Parameters
Type Name Description
System.Xml.XmlDocument XmlMenuDocument
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX