MWSSettingsMenu Class
Namespace:
Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
MWSSettingsMenu
Description
The Microsoft.SharePoint.WebControls.MWSSettingsMenu class inherits from the Microsoft.SharePoint.WebControls.SettingsMenu class which sponsors a "Settings" menu. As with the SettingsMenu class, the default menu items in the MWSSettingsMenu class can be overridden and the menu depends on the current context.
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 proper MenuItemTemplate object hydration before they are visibly toggled in the parent settings item collection.
Usage Scenarios
Similar to the inherited Microsoft.SharePoint.WebControls.SettingsMenu control, the MWSActionsMenu is most frequently seen in combination with the ToolBar class. Off the SettingsMenu object, the Microsoft.SharePoint.WebControls.ToolBarMenuButton.AddMenuItem method is the most used in order to add items to the parent menu object to override default values.
The following code shows how to create a SettingsMenu object in an exclusive method that has the addition of one item using ToolBarMenuButton.AddMenuItem method which will query the SettingsMenu object for some properties values.
C# Code Sample
private SettingsMenu ExampleMWSSettingsMenu;
private SettingsMenu CreateMWSSettingsMenu()
{
ExampleMWSSettingsMenu = new SettingsMenu();
ExampleMWSSettingsMenu.ID = "ExampleMWSSettingsMenu";
ExampleMWSSettingsMenu.Text = "MWS Settings";
ExampleMWSSettingsMenu.AlignToParent = true;
ExampleMWSSettingsMenu.MenuAlignment = MenuAlignment.Right;
ExampleMWSSettingsMenu.AddMenuItem("Adam", "Buenz", "", string.Format("Adam Buenz is a WSS MVP.{0}{1}", ExampleMWSSettingsMenu.Controls[0], ExampleMWSSettingsMenu.Controls.Count), "", "");
return ExampleMWSSettingsMenu;
}
Visual Basic .NET Code Sample
Private ExampleMWSSettingsMenu As SettingsMenu
Private Function CreateMWSSettingsMenu() As SettingsMenu
ExampleMWSSettingsMenu = New SettingsMenu()
ExampleMWSSettingsMenu.ID = "ExampleMWSSettingsMenu"
ExampleMWSSettingsMenu.Text = "MWS Settings"
ExampleMWSSettingsMenu.AlignToParent = True
ExampleMWSSettingsMenu.MenuAlignment = MenuAlignment.Right
ExampleMWSSettingsMenu.AddMenuItem("Adam", "Buenz", "", String.Format("Adam Buenz is a WSS MVP.{0}{1}", ExampleMWSSettingsMenu.Controls(0), ExampleMWSSettingsMenu.Controls.Count), "", "")
Return ExampleMWSSettingsMenu
End Function
Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com
The Microsoft.SharePoint.WebControls.MWSSettingsMenu class inherits from the Microsoft.SharePoint.WebControls.SettingsMenu class which sponsors a "Settings" menu. As with the SettingsMenu class, the default menu items in the MWSSettingsMenu class can be overridden and the menu depends on the current context.
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 proper MenuItemTemplate object hydration before they are visibly toggled in the parent settings item collection.
Usage Scenarios
Similar to the inherited Microsoft.SharePoint.WebControls.SettingsMenu control, the MWSActionsMenu is most frequently seen in combination with the ToolBar class. Off the SettingsMenu object, the Microsoft.SharePoint.WebControls.ToolBarMenuButton.AddMenuItem method is the most used in order to add items to the parent menu object to override default values.
The following code shows how to create a SettingsMenu object in an exclusive method that has the addition of one item using ToolBarMenuButton.AddMenuItem method which will query the SettingsMenu object for some properties values.
C# Code Sample
private SettingsMenu ExampleMWSSettingsMenu;
private SettingsMenu CreateMWSSettingsMenu()
{
ExampleMWSSettingsMenu = new SettingsMenu();
ExampleMWSSettingsMenu.ID = "ExampleMWSSettingsMenu";
ExampleMWSSettingsMenu.Text = "MWS Settings";
ExampleMWSSettingsMenu.AlignToParent = true;
ExampleMWSSettingsMenu.MenuAlignment = MenuAlignment.Right;
ExampleMWSSettingsMenu.AddMenuItem("Adam", "Buenz", "", string.Format("Adam Buenz is a WSS MVP.{0}{1}", ExampleMWSSettingsMenu.Controls[0], ExampleMWSSettingsMenu.Controls.Count), "", "");
return ExampleMWSSettingsMenu;
}
Visual Basic .NET Code Sample
Private ExampleMWSSettingsMenu As SettingsMenu
Private Function CreateMWSSettingsMenu() As SettingsMenu
ExampleMWSSettingsMenu = New SettingsMenu()
ExampleMWSSettingsMenu.ID = "ExampleMWSSettingsMenu"
ExampleMWSSettingsMenu.Text = "MWS Settings"
ExampleMWSSettingsMenu.AlignToParent = True
ExampleMWSSettingsMenu.MenuAlignment = MenuAlignment.Right
ExampleMWSSettingsMenu.AddMenuItem("Adam", "Buenz", "", String.Format("Adam Buenz is a WSS MVP.{0}{1}", ExampleMWSSettingsMenu.Controls(0), ExampleMWSSettingsMenu.Controls.Count), "", "")
Return ExampleMWSSettingsMenu
End Function
Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com
- 6/3/2010
- Adam Buenz - MVP