1 write to Menu
System.Web (1)
UI\WebControls\MenuRenderer.cs (1)
11
Menu
= menu;
285 references to Menu
System.Web (285)
UI\WebControls\MenuRendererClassic.cs (136)
23
if (
Menu
.Page == null) {
28
if (
Menu
.Page.Header == null) {
29
if (
Menu
._staticHoverStyle != null) {
32
if (
Menu
._dynamicHoverStyle != null) {
38
Menu
._isNotIE = (
Menu
.Page.Request.Browser.MSDomVersion.Major < 4);
40
if (
Menu
.Page.SupportsStyleSheets || (
Menu
.Page.ScriptManager != null &&
Menu
.Page.ScriptManager.IsInAsyncPostBack)) {
42
Menu
._panelStyle =
Menu
.Panel.GetEmptyPopOutPanelStyle();
43
RegisterStyle(
Menu
._panelStyle);
45
RegisterStyle(
Menu
.RootMenuItemStyle);
47
RegisterStyle(
Menu
.ControlStyle);
52
if (
Menu
._staticItemStyle != null) {
53
Menu
._staticItemStyle.HyperLinkStyle.DoNotRenderDefaults = true;
54
RegisterStyle(
Menu
._staticItemStyle.HyperLinkStyle);
55
RegisterStyle(
Menu
._staticItemStyle);
57
if (
Menu
._staticMenuStyle != null) {
58
RegisterStyle(
Menu
._staticMenuStyle);
61
if (
Menu
._dynamicItemStyle != null) {
62
Menu
._dynamicItemStyle.HyperLinkStyle.DoNotRenderDefaults = true;
63
RegisterStyle(
Menu
._dynamicItemStyle.HyperLinkStyle);
64
RegisterStyle(
Menu
._dynamicItemStyle);
66
if (
Menu
._dynamicMenuStyle != null) {
67
RegisterStyle(
Menu
._dynamicMenuStyle);
70
foreach (MenuItemStyle style in
Menu
.LevelMenuItemStyles) {
75
foreach (SubMenuStyle style in
Menu
.LevelSubMenuStyles) {
79
if (
Menu
._staticSelectedStyle != null) {
80
Menu
._staticSelectedStyle.HyperLinkStyle.DoNotRenderDefaults = true;
81
RegisterStyle(
Menu
._staticSelectedStyle.HyperLinkStyle);
82
RegisterStyle(
Menu
._staticSelectedStyle);
84
if (
Menu
._dynamicSelectedStyle != null) {
85
Menu
._dynamicSelectedStyle.HyperLinkStyle.DoNotRenderDefaults = true;
86
RegisterStyle(
Menu
._dynamicSelectedStyle.HyperLinkStyle);
87
RegisterStyle(
Menu
._dynamicSelectedStyle);
89
foreach (MenuItemStyle style in
Menu
.LevelSelectedStyles) {
95
if (
Menu
._staticHoverStyle != null) {
96
Menu
._staticHoverHyperLinkStyle = new HyperLinkStyle(
Menu
._staticHoverStyle);
97
Menu
._staticHoverHyperLinkStyle.DoNotRenderDefaults = true;
98
RegisterStyle(
Menu
._staticHoverHyperLinkStyle);
99
RegisterStyle(
Menu
._staticHoverStyle);
101
if (
Menu
._dynamicHoverStyle != null) {
102
Menu
._dynamicHoverHyperLinkStyle = new HyperLinkStyle(
Menu
._dynamicHoverStyle);
103
Menu
._dynamicHoverHyperLinkStyle.DoNotRenderDefaults = true;
104
RegisterStyle(
Menu
._dynamicHoverHyperLinkStyle);
105
RegisterStyle(
Menu
._dynamicHoverStyle);
113
if (
Menu
.Page != null && registerScript) {
115
Menu
.Page.RegisterWebFormsScript();
117
Menu
.Page.ClientScript.RegisterClientScriptResource(
Menu
, typeof(Menu), "Menu.js");
119
string clientDataObjectID =
Menu
.ClientDataObjectID;
127
createDataObjectScript.Append(
Menu
.DisappearAfter);
131
createDataObjectScript.Append(
Menu
.DynamicHorizontalOffset);
135
createDataObjectScript.Append(
Menu
.DynamicVerticalOffset);
137
if (
Menu
._dynamicHoverStyle != null) {
140
createDataObjectScript.Append(
Menu
._dynamicHoverStyle.RegisteredCssClass);
141
if (!String.IsNullOrEmpty(
Menu
._dynamicHoverStyle.CssClass)) {
142
if (!String.IsNullOrEmpty(
Menu
._dynamicHoverStyle.RegisteredCssClass)) {
145
createDataObjectScript.Append(
Menu
._dynamicHoverStyle.CssClass);
148
if (
Menu
._dynamicHoverHyperLinkStyle != null) {
151
createDataObjectScript.Append(
Menu
._dynamicHoverHyperLinkStyle.RegisteredCssClass);
152
if (!String.IsNullOrEmpty(
Menu
._dynamicHoverStyle.CssClass)) {
153
if (!String.IsNullOrEmpty(
Menu
._dynamicHoverHyperLinkStyle.RegisteredCssClass)) {
156
createDataObjectScript.Append(
Menu
._dynamicHoverStyle.CssClass);
161
if (
Menu
._staticHoverStyle != null &&
Menu
._staticHoverHyperLinkStyle != null) {
164
createDataObjectScript.Append(
Menu
._staticHoverStyle.RegisteredCssClass);
165
if (!String.IsNullOrEmpty(
Menu
._staticHoverStyle.CssClass)) {
166
if (!String.IsNullOrEmpty(
Menu
._staticHoverStyle.RegisteredCssClass)) {
169
createDataObjectScript.Append(
Menu
._staticHoverStyle.CssClass);
172
if (
Menu
._staticHoverHyperLinkStyle != null) {
175
createDataObjectScript.Append(
Menu
._staticHoverHyperLinkStyle.RegisteredCssClass);
176
if (!String.IsNullOrEmpty(
Menu
._staticHoverStyle.CssClass)) {
177
if (!String.IsNullOrEmpty(
Menu
._staticHoverHyperLinkStyle.RegisteredCssClass)) {
180
createDataObjectScript.Append(
Menu
._staticHoverStyle.CssClass);
185
if ((
Menu
.Page.RequestInternal != null) &&
186
(String.Equals(
Menu
.Page.Request.Url.Scheme, "https", StringComparison.OrdinalIgnoreCase))) {
191
Menu
.Page.ClientScript.GetWebResourceUrl(typeof(Menu), "SmartNav.htm"),
197
Menu
.Page.ClientScript.RegisterStartupScript(
Menu
, GetType(),
198
Menu
.ClientID + "_CreateDataObject",
205
if (
Menu
.Page != null &&
Menu
.Page.SupportsStyleSheets) {
206
string name =
Menu
.ClientID + "_" + _cssStyleIndex++.ToString(NumberFormatInfo.InvariantInfo);
207
Menu
.Page.Header.StyleSheet.CreateStyleRule(style,
Menu
, "." + name);
213
ControlRenderingHelper.WriteSkipLinkStart(writer,
Menu
.RenderingCompatibility,
Menu
.DesignMode,
Menu
.SkipLinkText,
Menu
.SpacerImageUrl,
Menu
.ClientID);
218
Menu
.EnsureRootMenuStyle();
219
if (
Menu
.Font != null) {
221
Menu
.Font.Reset();
223
Menu
.ForeColor = Color.Empty;
224
SubMenuStyle rootMenuStyle =
Menu
.GetSubMenuStyle(
Menu
.RootItem);
225
if (
Menu
.Page != null &&
Menu
.Page.SupportsStyleSheets) {
226
string styleClass =
Menu
.GetSubMenuCssClassName(
Menu
.RootItem);
228
if (
Menu
.CssClass.Length == 0) {
229
Menu
.CssClass = styleClass;
232
Menu
.CssClass += ' ' + styleClass;
243
Menu
.ControlStyle.CopyFrom(rootMenuStyle);
247
Menu
.AddAttributesToRender(writer);
256
if (
Menu
.Orientation == Orientation.Horizontal) {
260
bool enabled =
Menu
.IsEnabled;
261
if (
Menu
.StaticDisplayLevels > 1) {
262
if (
Menu
.Orientation == Orientation.Vertical) {
264
for (int i = 0; i <
Menu
.Items.Count; i++) {
265
Menu
.Items[i].RenderItem(writer, i, enabled,
Menu
.Orientation, staticOnly);
267
if (
Menu
.Items[i].ChildItems.Count != 0) {
270
Menu
.Items[i].Render(writer, enabled, staticOnly);
278
for (int i = 0; i <
Menu
.Items.Count; i++) {
279
Menu
.Items[i].RenderItem(writer, i, enabled,
Menu
.Orientation, staticOnly);
281
if (
Menu
.Items[i].ChildItems.Count != 0) {
283
Menu
.Items[i].Render(writer, enabled, staticOnly);
291
for (int i = 0; i <
Menu
.Items.Count; i++) {
292
Menu
.Items[i].RenderItem(writer, i, enabled,
Menu
.Orientation, staticOnly);
296
if (
Menu
.Orientation == Orientation.Horizontal) {
302
if (
Menu
.DesignMode) {
303
Menu
.ResetCachedStyles();
311
if (
Menu
.StaticDisplayLevels <= 1 && !staticOnly) {
312
bool enabled =
Menu
.IsEnabled;
313
for (int i = 0; i <
Menu
.Items.Count; i++) {
314
Menu
.Items[i].Render(writer, enabled, staticOnly);
318
ControlRenderingHelper.WriteSkipLinkEnd(writer,
Menu
.DesignMode,
Menu
.SkipLinkText,
Menu
.ClientID);
UI\WebControls\MenuRendererStandards.cs (149)
34
return
Menu
.SpacerImageUrl;
48
string key = "_registerMenu_" +
Menu
.ClientID;
53
Menu
.ClientID,
54
Menu
.DisappearAfter,
55
Menu
.Orientation.ToString().ToLowerInvariant(),
56
Menu
.TabIndex,
57
(!
Menu
.IsEnabled).ToString().ToLowerInvariant());
59
if (
Menu
.Page.ScriptManager != null) {
60
Menu
.Page.ScriptManager.RegisterClientScriptResource(
Menu
.Page, typeof(Menu), "MenuStandards.js");
61
Menu
.Page.ScriptManager.RegisterStartupScript(
Menu
, typeof(MenuRendererStandards), key, initScript, false);
64
Menu
.Page.ClientScript.RegisterClientScriptResource(
Menu
.Page, typeof(Menu), "MenuStandards.js");
65
Menu
.Page.ClientScript.RegisterStartupScript(typeof(MenuRendererStandards), key, initScript);
70
if (
Menu
.IncludeStyleBlock) {
71
Menu
.Page.Header.Controls.Add(CreateStyleBlock());
77
Style rootMenuItemStyle =
Menu
.RootMenuItemStyle;
82
if (!
Menu
.ControlStyle.IsEmpty) {
84
menuStyle.CopyFrom(
Menu
.ControlStyle);
93
styleBlock.AddStyleDefinition("#{0}",
Menu
.ClientID)
98
styleBlock.AddStyleDefinition("#{0} img.icon",
Menu
.ClientID)
102
styleBlock.AddStyleDefinition("#{0} img.separator",
Menu
.ClientID)
106
if (
Menu
.Orientation == Orientation.Horizontal) {
107
styleBlock.AddStyleDefinition("#{0} img.horizontal-separator",
Menu
.ClientID)
114
styleBlock.AddStyleDefinition("#{0} ul",
Menu
.ClientID)
120
styleBlock.AddStyleDefinition("#{0} ul.static",
Menu
.ClientID)
121
.AddStyles(
Menu
._staticMenuStyle);
123
var ulDynamic = styleBlock.AddStyleDefinition("#{0} ul.dynamic",
Menu
.ClientID)
124
.AddStyles(
Menu
._dynamicMenuStyle)
127
if (
Menu
.DynamicHorizontalOffset != 0) {
128
ulDynamic.AddStyle(HtmlTextWriterStyle.MarginLeft,
Menu
.DynamicHorizontalOffset.ToString(CultureInfo.InvariantCulture) + "px");
131
if (
Menu
.DynamicVerticalOffset != 0) {
132
ulDynamic.AddStyle(HtmlTextWriterStyle.MarginTop,
Menu
.DynamicVerticalOffset.ToString(CultureInfo.InvariantCulture) + "px");
135
if (
Menu
._levelStyles != null) {
138
foreach (SubMenuStyle style in
Menu
._levelStyles) {
139
styleBlock.AddStyleDefinition("#{0} ul.level{1}",
Menu
.ClientID, index++)
150
styleBlock.AddStyleDefinition("#{0} a",
Menu
.ClientID)
155
var menuItemStatic = styleBlock.AddStyleDefinition("#{0} a.static",
Menu
.ClientID);
156
if ((
Menu
.Orientation == Orientation.Horizontal) &&
157
((
Menu
._staticItemStyle == null) || (
Menu
._staticItemStyle.HorizontalPadding.IsEmpty))) {
161
menuItemStatic.AddStyles(
Menu
._staticItemStyle);
163
if (
Menu
._staticItemStyle != null) {
164
menuItemStatic.AddStyles(
Menu
._staticItemStyle.HyperLinkStyle);
168
styleBlock.AddStyleDefinition("#{0} a.popout",
Menu
.ClientID)
169
.AddStyle("background-image", "url(\"" +
Menu
.ResolveClientUrl(StaticPopOutUrl).Replace("\"", "\\\"") + "\")")
178
styleBlock.AddStyleDefinition("#{0} a.popout-dynamic",
Menu
.ClientID)
179
.AddStyle("background", "url(\"" +
Menu
.ResolveClientUrl(DynamicPopOutUrl).Replace("\"", "\\\"") + "\") no-repeat right center")
184
var styleBlockStyles = styleBlock.AddStyleDefinition("#{0} a.dynamic",
Menu
.ClientID)
185
.AddStyles(
Menu
._dynamicItemStyle);
186
if (
Menu
._dynamicItemStyle != null) {
187
styleBlockStyles.AddStyles(
Menu
._dynamicItemStyle.HyperLinkStyle);
190
if (
Menu
._levelMenuItemStyles != null ||
Menu
.StaticDisplayLevels > 1) {
191
int lastIndex =
Menu
.StaticDisplayLevels;
192
if (
Menu
._levelMenuItemStyles != null) {
193
lastIndex = Math.Max(lastIndex,
Menu
._levelMenuItemStyles.Count);
197
var style = styleBlock.AddStyleDefinition("#{0} a.level{1}",
Menu
.ClientID, index + 1);
199
if (index > 0 && index <
Menu
.StaticDisplayLevels) {
200
Unit indent =
Menu
.StaticSubMenuIndent;
204
if (indent.IsEmpty &&
Menu
.Orientation == Orientation.Vertical) {
221
if (
Menu
._levelMenuItemStyles != null && index <
Menu
._levelMenuItemStyles.Count) {
222
var levelItemStyle =
Menu
._levelMenuItemStyles[index];
228
styleBlockStyles = styleBlock.AddStyleDefinition("#{0} a.static.selected",
Menu
.ClientID)
229
.AddStyles(
Menu
._staticSelectedStyle);
230
if (
Menu
._staticSelectedStyle != null) {
231
styleBlockStyles.AddStyles(
Menu
._staticSelectedStyle.HyperLinkStyle);
234
styleBlockStyles = styleBlock.AddStyleDefinition("#{0} a.dynamic.selected",
Menu
.ClientID)
235
.AddStyles(
Menu
._dynamicSelectedStyle);
236
if (
Menu
._dynamicSelectedStyle != null) {
237
styleBlockStyles.AddStyles(
Menu
._dynamicSelectedStyle.HyperLinkStyle);
240
styleBlock.AddStyleDefinition("#{0} a.static.highlighted",
Menu
.ClientID)
241
.AddStyles(
Menu
._staticHoverStyle);
243
styleBlock.AddStyleDefinition("#{0} a.dynamic.highlighted",
Menu
.ClientID)
244
.AddStyles(
Menu
._dynamicHoverStyle);
246
if (
Menu
._levelSelectedStyles != null) {
249
foreach (MenuItemStyle style in
Menu
._levelSelectedStyles) {
250
styleBlock.AddStyleDefinition("#{0} a.selected.level{1}",
Menu
.ClientID, index++)
262
if (level >
Menu
.StaticDisplayLevels) {
266
if (
Menu
.DesignMode) {
268
if (
Menu
.Orientation == Orientation.Horizontal) {
292
string url =
Menu
.DynamicPopOutImageUrl;
293
if (String.IsNullOrEmpty(url) &&
Menu
.DynamicEnableDefaultPopOutImage) {
294
url =
Menu
.GetImageUrl(Menu.PopOutImageIndex);
300
string url =
Menu
.StaticPopOutImageUrl;
301
if (String.IsNullOrEmpty(url) &&
Menu
.StaticEnableDefaultPopOutImage) {
302
url =
Menu
.GetImageUrl(Menu.PopOutImageIndex);
308
return GetCssClass(level,
Menu
.StaticMenuStyle,
Menu
.DynamicMenuStyle,
Menu
._levelStyles);
315
if (level >
Menu
.StaticDisplayLevels) {
324
string levelCssClass = GetCssClass(level,
Menu
.StaticMenuItemStyle,
Menu
.DynamicMenuItemStyle,
Menu
._levelMenuItemStyles);
334
return
Menu
.Page.ClientScript.GetPostBackEventReference(
Menu
, item.InternalValuePath, true);
338
return (item.Depth + 1 >=
Menu
.MaximumDepth);
342
return (item.Depth + 1 >=
Menu
.StaticDisplayLevels);
351
return (item.Depth >=
Menu
.StaticDisplayLevels);
359
if (
Menu
.DesignMode ||
Menu
.Page == null) {
363
if (
Menu
.IncludeStyleBlock &&
Menu
.Page.Header == null) {
372
ControlRenderingHelper.WriteSkipLinkStart(writer,
Menu
.RenderingCompatibility,
Menu
.DesignMode,
Menu
.SkipLinkText, SpacerImageUrl,
Menu
.ClientID);
374
if (
Menu
.DesignMode &&
Menu
.IncludeStyleBlock) {
380
if (
Menu
.HasAttributes) {
381
foreach (string key in
Menu
.Attributes.Keys) {
382
writer.AddAttribute(key,
Menu
.Attributes[key]);
387
string cssClass =
Menu
.CssClass ?? "";
388
if (!
Menu
.Enabled) {
396
if (
Menu
.DesignMode) {
400
writer.AddAttribute(HtmlTextWriterAttribute.Id,
Menu
.ClientID);
405
RenderItems(writer, staticOnly ||
Menu
.DesignMode || !
Menu
.Enabled,
Menu
.Items, 1, !String.IsNullOrEmpty(
Menu
.AccessKey));
412
if (
Menu
.DesignMode) {
418
ControlRenderingHelper.WriteSkipLinkEnd(writer,
Menu
.DesignMode,
Menu
.SkipLinkText,
Menu
.ClientID);
424
if (
Menu
.DesignMode &&
Menu
.Orientation == Orientation.Horizontal) {
444
writer.AddAttribute(HtmlTextWriterAttribute.Src,
Menu
.ResolveClientUrl(item.ImageUrl));
458
if (!item.Enabled || !
Menu
.Enabled) {
475
writer.AddAttribute(HtmlTextWriterAttribute.Accesskey,
Menu
.AccessKey);
485
writer.AddAttribute(HtmlTextWriterAttribute.Href,
Menu
.ResolveClientUrl(item.NavigateUrl));
489
target =
Menu
.Target;
503
?
Menu
.StaticBottomSeparatorImageUrl
504
:
Menu
.DynamicBottomSeparatorImageUrl;
514
?
Menu
.StaticTopSeparatorImageUrl
515
:
Menu
.DynamicTopSeparatorImageUrl;
523
if (
Menu
.RenderingCompatibility >= VersionUtil.Framework45) {
527
separatorImageUrl =
Menu
.ResolveClientUrl(separatorImageUrl);
533
IsDepthStatic(item) &&
Menu
.Orientation == Orientation.Horizontal ? "horizontal-separator" : "separator");
539
if (level == 1 || level >
Menu
.StaticDisplayLevels) { // Render a <UL> to start, and for all dynamic descendents
540
if (
Menu
.DesignMode &&
Menu
.Orientation == Orientation.Horizontal) {
548
if (
Menu
.DesignMode &&
Menu
.Orientation == Orientation.Horizontal) {
556
if (level <
Menu
.StaticDisplayLevels) { // Close off <LI> if we (and our direct descendents) are static
561
if (level <
Menu
.StaticDisplayLevels || !staticOnly) {
566
if (level >=
Menu
.StaticDisplayLevels) { // Close off <LI> if we (or our direct descendents) are dynamic
571
if (level == 1 || level >
Menu
.StaticDisplayLevels) {