Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebControls / MenuItemStyleCollection.cs / 1 / MenuItemStyleCollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Security.Permissions;
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class MenuItemStyleCollection : StateManagedCollection {
private static readonly Type[] knownTypes = new Type[] { typeof(MenuItemStyle) };
internal MenuItemStyleCollection() {
}
protected override void OnInsert(int index, object value) {
base.OnInsert(index, value);
if (value is MenuItemStyle) {
MenuItemStyle style = (MenuItemStyle)value;
style.Font.Underline = style.Font.Underline;
}
else {
throw new ArgumentException(SR.GetString(SR.MenuItemStyleCollection_InvalidArgument), "value");
}
}
public MenuItemStyle this[int i] {
get {
return (MenuItemStyle)((IList)this)[i];
}
set {
((IList)this)[i] = value;
}
}
public int Add(MenuItemStyle style) {
return ((IList)this).Add(style);
}
public bool Contains(MenuItemStyle style) {
return ((IList)this).Contains(style);
}
public void CopyTo(MenuItemStyle[] styleArray, int index) {
base.CopyTo(styleArray, index);
}
public int IndexOf(MenuItemStyle style) {
return ((IList)this).IndexOf(style);
}
public void Insert(int index, MenuItemStyle style) {
((IList)this).Insert(index, style);
}
protected override object CreateKnownType(int index) {
return new MenuItemStyle();
}
protected override Type[] GetKnownTypes() {
return knownTypes;
}
public void Remove(MenuItemStyle style) {
((IList)this).Remove(style);
}
public void RemoveAt(int index) {
((IList)this).RemoveAt(index);
}
protected override void SetDirtyObject(object o) {
if (o is MenuItemStyle) {
((MenuItemStyle)o).SetDirty();
}
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlSerializerNamespaces.cs
- SqlCacheDependency.cs
- WindowsTreeView.cs
- HttpChannelHelpers.cs
- CrossAppDomainChannel.cs
- HyperLinkField.cs
- BindingMAnagerBase.cs
- UniqueSet.cs
- MenuCommand.cs
- assemblycache.cs
- XsdBuildProvider.cs
- ControlAdapter.cs
- XPathAncestorIterator.cs
- XPathMessageFilterElementCollection.cs
- MultipleViewPattern.cs
- ForceCopyBuildProvider.cs
- TimerElapsedEvenArgs.cs
- XmlSerializableServices.cs
- XmlUTF8TextReader.cs
- ProtocolProfile.cs
- SchemaImporterExtensionElementCollection.cs
- AspNetRouteServiceHttpHandler.cs
- StructuralObject.cs
- TCPClient.cs
- WindowsRebar.cs
- BindingContext.cs
- SafeMILHandle.cs
- BaseParser.cs
- ToolboxItem.cs
- EmptyControlCollection.cs
- ThreadStaticAttribute.cs
- FileDialog.cs
- TransactionContextValidator.cs
- XsltSettings.cs
- RSAOAEPKeyExchangeFormatter.cs
- SystemIcmpV4Statistics.cs
- DataGridViewRowStateChangedEventArgs.cs
- DtdParser.cs
- ObjectStateManager.cs
- DefaultMemberAttribute.cs
- ModelItemCollection.cs
- DictionaryEntry.cs
- ListenerServiceInstallComponent.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- DriveNotFoundException.cs
- TemplateBindingExpressionConverter.cs
- RuntimeVariableList.cs
- LocalizableAttribute.cs
- XsltException.cs
- PtsHost.cs
- PeerToPeerException.cs
- Types.cs
- DefaultValueMapping.cs
- LingerOption.cs
- ReadOnlyCollectionBase.cs
- LookupNode.cs
- DataTrigger.cs
- DynamicRouteExpression.cs
- EntityClientCacheEntry.cs
- GridItemCollection.cs
- Errors.cs
- ErrorRuntimeConfig.cs
- DispatcherExceptionEventArgs.cs
- SafeTimerHandle.cs
- basecomparevalidator.cs
- XmlIlGenerator.cs
- UnmanagedMemoryStreamWrapper.cs
- DataGridColumnsPage.cs
- itemelement.cs
- ScriptBehaviorDescriptor.cs
- XmlElementList.cs
- DateTimeParse.cs
- TableLayoutCellPaintEventArgs.cs
- CompilationUnit.cs
- HttpRequestCacheValidator.cs
- FeatureSupport.cs
- TableRowGroupCollection.cs
- ChineseLunisolarCalendar.cs
- NullableConverter.cs
- Part.cs
- XComponentModel.cs
- ControlHelper.cs
- Path.cs
- DeclarationUpdate.cs
- CompilerCollection.cs
- Utils.cs
- PageThemeCodeDomTreeGenerator.cs
- ApplicationActivator.cs
- GridEntry.cs
- UserControlCodeDomTreeGenerator.cs
- SHA512.cs
- OleDbCommandBuilder.cs
- NoClickablePointException.cs
- FixedPosition.cs
- SelectingProviderEventArgs.cs
- TypeDescriptionProviderAttribute.cs
- NullExtension.cs
- LinkedResourceCollection.cs
- basenumberconverter.cs
- CodeMemberEvent.cs