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()
Assembly: CADability.dll
public class MenuResource
Methods
|
Improve this Doc
View Source
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
Returns
|
Improve this Doc
View Source
Declaration
public static int FindImageIndex(string MenuID)
Parameters
| Type |
Name |
Description |
| System.String |
MenuID |
|
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
Declaration
public static string[] GetPopupItems(string MenuName)
Parameters
| Type |
Name |
Description |
| System.String |
MenuName |
|
Returns
| Type |
Description |
| System.String[] |
|
|
Improve this Doc
View Source
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
|
Improve this Doc
View Source
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
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
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 |
|