MWSActionsMenu Class
Namespace:
Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
MWSActionsMenu
Description
The Microsoft.SharePoint.WebControls.MWSActionsMenu class inherits from the Microsoft.SharePoint.WebControls.ActionsMenu class which sponsors an "Actions" menu. As the default menu items presented for an ActionsMenu control are context dependent, there are Meeting Workspace calls within the derived MWSActionMenu class.
It should be noted that the MWS class name prefix, as with other similarly decorated classes denotes that this class provides a Meeting Workspace implementation of a pre-existing SharePoint class (MWS<classname>).
The MWSActionsMenu control promotes its implementation by overriding the ToolBarMenuButton.SetMenuItemProperties method, which is accountable for setting specific Microsoft.SharePoint.WebControls.MenuItemTemplate object properties. Within this method, there are conditional checks to ensure the proper MenuItemTemplate objects are displayed by comparing context against various SPListTemplateType enumerators.
Usage Scenarios
Similar to the inherted Microsoft.SharePoint.WebControls.ActionsMenu control, the MWSActionsMenu is most frequently seen in combination with the ToolBar class. Off the MWSActionMenu object the Microsoft.SharePoint.WebControls.ToolBarMenuButton.AddMenuItem method is the most used in order to add items to the parent menu object.
The following code shows how to create a MWSActionMenu object in a exclusive method that has the addition of one item using ToolBarMenuButton.AddMenuItem method which will query a global SettingsMenu object for some properties values.
C# Code Sample
private MWSActionsMenu ExampleMWSActionsMenu;
private SettingsMenu ExampleSettingsMenu;
private MWSActionsMenu GenerateMWSActionsMenu()
{
ExampleMWSActionsMenu = new MWSActionsMenu();
ExampleMWSActionsMenu.ID = "TestMWSActionsMenu";
ExampleMWSActionsMenu.Text = "TestMWSActionsMenu";
ExampleMWSActionsMenu.AlignToParent = true;
ExampleMWSActionsMenu.MenuAlignment = MenuAlignment.Right;
ExampleMWSActionsMenu.AddMenuItem("Adam", "Buenz", "", "Adam Buenz Is A WSS MVP." + ExampleSettingsMenu.Controls[0] + ExampleSettingsMenu.Controls.Count, "", "");
return ExampleMWSActionsMenu;
}
Visual Basic .NET Code Sample
Private ExampleMWSActionsMenu As MWSActionsMenu
Private ExampleSettingsMenu As SettingsMenu
Private Function GenerateMWSActionsMenu() As MWSActionsMenu
ExampleMWSActionsMenu = New MWSActionsMenu()
ExampleMWSActionsMenu.ID = "TestMWSActionsMenu"
ExampleMWSActionsMenu.Text = "TestMWSActionsMenu"
ExampleMWSActionsMenu.AlignToParent = True
ExampleMWSActionsMenu.MenuAlignment = MenuAlignment.Right
ExampleMWSActionsMenu.AddMenuItem("Adam", "Buenz", "", "Adam Is A WSS MVP." + ExampleSettingsMenu.Controls(0) + ExampleSettingsMenu.Controls.Count, "", "")
Return ExampleMWSActionsMenu
End Function
Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com
The Microsoft.SharePoint.WebControls.MWSActionsMenu class inherits from the Microsoft.SharePoint.WebControls.ActionsMenu class which sponsors an "Actions" menu. As the default menu items presented for an ActionsMenu control are context dependent, there are Meeting Workspace calls within the derived MWSActionMenu class.
It should be noted that the MWS class name prefix, as with other similarly decorated classes denotes that this class provides a Meeting Workspace implementation of a pre-existing SharePoint class (MWS<classname>).
The MWSActionsMenu control promotes its implementation by overriding the ToolBarMenuButton.SetMenuItemProperties method, which is accountable for setting specific Microsoft.SharePoint.WebControls.MenuItemTemplate object properties. Within this method, there are conditional checks to ensure the proper MenuItemTemplate objects are displayed by comparing context against various SPListTemplateType enumerators.
Usage Scenarios
Similar to the inherted Microsoft.SharePoint.WebControls.ActionsMenu control, the MWSActionsMenu is most frequently seen in combination with the ToolBar class. Off the MWSActionMenu object the Microsoft.SharePoint.WebControls.ToolBarMenuButton.AddMenuItem method is the most used in order to add items to the parent menu object.
The following code shows how to create a MWSActionMenu object in a exclusive method that has the addition of one item using ToolBarMenuButton.AddMenuItem method which will query a global SettingsMenu object for some properties values.
C# Code Sample
private MWSActionsMenu ExampleMWSActionsMenu;
private SettingsMenu ExampleSettingsMenu;
private MWSActionsMenu GenerateMWSActionsMenu()
{
ExampleMWSActionsMenu = new MWSActionsMenu();
ExampleMWSActionsMenu.ID = "TestMWSActionsMenu";
ExampleMWSActionsMenu.Text = "TestMWSActionsMenu";
ExampleMWSActionsMenu.AlignToParent = true;
ExampleMWSActionsMenu.MenuAlignment = MenuAlignment.Right;
ExampleMWSActionsMenu.AddMenuItem("Adam", "Buenz", "", "Adam Buenz Is A WSS MVP." + ExampleSettingsMenu.Controls[0] + ExampleSettingsMenu.Controls.Count, "", "");
return ExampleMWSActionsMenu;
}
Visual Basic .NET Code Sample
Private ExampleMWSActionsMenu As MWSActionsMenu
Private ExampleSettingsMenu As SettingsMenu
Private Function GenerateMWSActionsMenu() As MWSActionsMenu
ExampleMWSActionsMenu = New MWSActionsMenu()
ExampleMWSActionsMenu.ID = "TestMWSActionsMenu"
ExampleMWSActionsMenu.Text = "TestMWSActionsMenu"
ExampleMWSActionsMenu.AlignToParent = True
ExampleMWSActionsMenu.MenuAlignment = MenuAlignment.Right
ExampleMWSActionsMenu.AddMenuItem("Adam", "Buenz", "", "Adam Is A WSS MVP." + ExampleSettingsMenu.Controls(0) + ExampleSettingsMenu.Controls.Count, "", "")
Return ExampleMWSActionsMenu
End Function
Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com
- 6/3/2010
- Adam Buenz - MVP