Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / DesignerAutoFormatCollection.cs / 1 / DesignerAutoFormatCollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.Design {
using System.Collections;
using System.Drawing;
///
public sealed class DesignerAutoFormatCollection : IList {
private ArrayList _autoFormats = new ArrayList();
///
public int Count {
get {
return _autoFormats.Count;
}
}
///
public Size PreviewSize {
get {
int height = 200;
int width = 200;
foreach (DesignerAutoFormat f in _autoFormats) {
int heightValue = (int)f.Style.Height.Value;
if (heightValue > height) {
height = heightValue;
}
int widthValue = (int)f.Style.Width.Value;
if (widthValue > width) {
width = widthValue;
}
}
return new Size(width, height);
}
}
///
public Object SyncRoot {
get {
return this;
}
}
///
public DesignerAutoFormat this[int index] {
get {
return (DesignerAutoFormat)_autoFormats[index];
}
}
///
public int Add(DesignerAutoFormat format) {
return _autoFormats.Add(format);
}
///
public void Clear() {
_autoFormats.Clear();
}
///
public bool Contains(DesignerAutoFormat format) {
return _autoFormats.Contains(format);
}
///
public int IndexOf(DesignerAutoFormat format) {
return _autoFormats.IndexOf(format);
}
///
public void Insert(int index, DesignerAutoFormat format) {
_autoFormats.Insert(index, format);
}
///
public void Remove(DesignerAutoFormat format) {
_autoFormats.Remove(format);
}
///
public void RemoveAt(int index) {
_autoFormats.RemoveAt(index);
}
#region IList implementation
///
///
int ICollection.Count {
get {
return Count;
}
}
///
///
bool IList.IsFixedSize {
get {
return false;
}
}
///
///
bool IList.IsReadOnly {
get {
return false;
}
}
///
///
bool ICollection.IsSynchronized {
get {
return false;
}
}
///
///
object IList.this[int index] {
get {
return _autoFormats[index];
}
set {
if (value is DesignerAutoFormat) {
_autoFormats[index] = value;
}
}
}
///
///
int IList.Add(object value) {
if (value is DesignerAutoFormat) {
return Add((DesignerAutoFormat)value);
}
return -1;
}
///
///
bool IList.Contains(object value) {
if (value is DesignerAutoFormat) {
return Contains((DesignerAutoFormat)value);
}
return false;
}
///
///
void ICollection.CopyTo(Array array, int index) {
_autoFormats.CopyTo(array, index);
}
///
///
IEnumerator IEnumerable.GetEnumerator() {
return _autoFormats.GetEnumerator();
}
///
///
int IList.IndexOf(object value) {
return IndexOf((DesignerAutoFormat)value);
}
///
///
void IList.Insert(int index, object value) {
if (value is DesignerAutoFormat) {
Insert(index, (DesignerAutoFormat)value);
}
}
///
///
void IList.RemoveAt(int index) {
RemoveAt(index);
}
///
///
void IList.Remove(object value) {
if (value is DesignerAutoFormat) {
Remove((DesignerAutoFormat)value);
}
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ModuleConfigurationInfo.cs
- URLString.cs
- HtmlTableRowCollection.cs
- MessageEncodingBindingElementImporter.cs
- DocumentGridContextMenu.cs
- AccessDataSource.cs
- DataRecordObjectView.cs
- sqlstateclientmanager.cs
- AnnotationComponentChooser.cs
- StrokeNode.cs
- SessionEndedEventArgs.cs
- SplineKeyFrames.cs
- WebPartTransformerAttribute.cs
- RegexCompiler.cs
- SymLanguageType.cs
- _FtpDataStream.cs
- WindowShowOrOpenTracker.cs
- ControlType.cs
- HostingEnvironmentWrapper.cs
- Matrix.cs
- ReadOnlyDictionary.cs
- AmbientProperties.cs
- PathGeometry.cs
- Vector3DAnimationUsingKeyFrames.cs
- HtmlControl.cs
- FormView.cs
- ComponentEvent.cs
- Button.cs
- NamespaceInfo.cs
- ListArgumentProvider.cs
- ReadWriteObjectLock.cs
- IPEndPoint.cs
- OdbcException.cs
- ServiceDescriptions.cs
- COAUTHINFO.cs
- EnumerableWrapperWeakToStrong.cs
- BitmapVisualManager.cs
- PropertyManager.cs
- ControlPager.cs
- CheckedPointers.cs
- KeySplineConverter.cs
- NameTable.cs
- FileDialog.cs
- SymbolEqualComparer.cs
- CompilerGlobalScopeAttribute.cs
- ValidationErrorEventArgs.cs
- ComboBoxDesigner.cs
- DateTimeParse.cs
- HttpResponseHeader.cs
- RegistryPermission.cs
- UICuesEvent.cs
- TextContainer.cs
- RNGCryptoServiceProvider.cs
- StandardCommands.cs
- SharedPersonalizationStateInfo.cs
- XmlCharacterData.cs
- ResourceAssociationSetEnd.cs
- ImmutableAssemblyCacheEntry.cs
- MemberInfoSerializationHolder.cs
- PasswordBox.cs
- HtmlHistory.cs
- NegotiateStream.cs
- ZipIOExtraFieldZip64Element.cs
- FontNameConverter.cs
- DesignerRegionMouseEventArgs.cs
- OutOfProcStateClientManager.cs
- ComponentConverter.cs
- FileDialog_Vista.cs
- SafeIUnknown.cs
- _HeaderInfo.cs
- ChannelBinding.cs
- SimpleType.cs
- ConnectionsZone.cs
- GroupBoxAutomationPeer.cs
- SingleAnimation.cs
- InvalidateEvent.cs
- PasswordDeriveBytes.cs
- PackageController.cs
- _WebProxyDataBuilder.cs
- InputProviderSite.cs
- PropertyConverter.cs
- FreezableDefaultValueFactory.cs
- XmlSerializableServices.cs
- SqlServer2KCompatibilityAnnotation.cs
- Graph.cs
- ProvideValueServiceProvider.cs
- XmlSchemaElement.cs
- ColumnMapVisitor.cs
- TraceLog.cs
- _ShellExpression.cs
- WebPartManagerInternals.cs
- hwndwrapper.cs
- ParseNumbers.cs
- RelatedCurrencyManager.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- ActivityExecutionContextCollection.cs
- HostProtectionPermission.cs
- ImageIndexConverter.cs
- CompositeDataBoundControl.cs
- BitmapMetadata.cs