Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / DesignerAutoFormat.cs / 1 / DesignerAutoFormat.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.Design {
using System;
using System.ComponentModel.Design;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;
using Control = System.Web.UI.Control;
///
public abstract class DesignerAutoFormat {
private string _name;
private DesignerAutoFormatStyle _style;
protected DesignerAutoFormat(string name) {
if ((name == null) || (name.Length == 0)) {
throw new ArgumentNullException("name");
}
_name = name;
}
///
public string Name {
get {
return _name;
}
}
public DesignerAutoFormatStyle Style {
get {
if (_style == null) {
_style = new DesignerAutoFormatStyle();
}
return _style;
}
}
///
public abstract void Apply(Control control);
public virtual Control GetPreviewControl(Control runtimeControl) {
IDesignerHost host = (IDesignerHost)runtimeControl.Site.GetService(typeof(IDesignerHost));
ControlDesigner designer = host.GetDesigner(runtimeControl) as ControlDesigner;
if (designer != null) {
return designer.CreateClonedControl(host, true);
}
return null;
}
///
public override string ToString() {
return Name;
}
}
}
// 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
- PagesChangedEventArgs.cs
- XmlDocumentSerializer.cs
- Point4D.cs
- StringBuilder.cs
- SqlDataSource.cs
- WorkflowTimerService.cs
- Splitter.cs
- CharacterBufferReference.cs
- COM2IDispatchConverter.cs
- MenuItemBinding.cs
- EastAsianLunisolarCalendar.cs
- MessageLogTraceRecord.cs
- CodeSubDirectory.cs
- EntityDataSourceContainerNameItem.cs
- sqlpipe.cs
- JournalEntry.cs
- ActivityInstanceReference.cs
- TraceLevelStore.cs
- PageEventArgs.cs
- CompilerGeneratedAttribute.cs
- UIElement.cs
- documentsequencetextpointer.cs
- ApplicationBuildProvider.cs
- UrlMappingCollection.cs
- EntryIndex.cs
- LineSegment.cs
- TextEditorSelection.cs
- Binding.cs
- ISAPIApplicationHost.cs
- MutexSecurity.cs
- ResourceManagerWrapper.cs
- IPipelineRuntime.cs
- BeginEvent.cs
- ExclusiveTcpListener.cs
- DelegateTypeInfo.cs
- StackSpiller.cs
- StrokeNodeEnumerator.cs
- InheritablePropertyChangeInfo.cs
- XamlUtilities.cs
- XmlSchemaValidationException.cs
- MatrixAnimationBase.cs
- AuthenticationModuleElementCollection.cs
- WmlValidatorAdapter.cs
- Funcletizer.cs
- CrossAppDomainChannel.cs
- Delegate.cs
- ToolStrip.cs
- DataBoundLiteralControl.cs
- COM2IDispatchConverter.cs
- DateTimePicker.cs
- WebPartConnectVerb.cs
- NameValuePair.cs
- DataSourceExpressionCollection.cs
- HandlerBase.cs
- ToolboxItemAttribute.cs
- XmlSchemaException.cs
- SoapDocumentServiceAttribute.cs
- IUnknownConstantAttribute.cs
- DrawTreeNodeEventArgs.cs
- PreloadedPackages.cs
- SrgsNameValueTag.cs
- ScrollChrome.cs
- PriorityBindingExpression.cs
- ArraySubsetEnumerator.cs
- CultureSpecificStringDictionary.cs
- WebPartDescriptionCollection.cs
- Types.cs
- GridViewColumnCollectionChangedEventArgs.cs
- DefaultWorkflowSchedulerService.cs
- TraceHwndHost.cs
- DataGridViewAccessibleObject.cs
- HwndStylusInputProvider.cs
- FunctionQuery.cs
- ILGenerator.cs
- DocumentViewerBase.cs
- URLAttribute.cs
- BuildProviderAppliesToAttribute.cs
- SmiRequestExecutor.cs
- sqlinternaltransaction.cs
- DataGridItemEventArgs.cs
- FontDriver.cs
- ArraySegment.cs
- AspCompat.cs
- CompositeDuplexElement.cs
- OdbcStatementHandle.cs
- QueueProcessor.cs
- MatrixCamera.cs
- SmtpNegotiateAuthenticationModule.cs
- _ConnectStream.cs
- StandardCommands.cs
- OracleRowUpdatingEventArgs.cs
- XmlCustomFormatter.cs
- OutputCacheProfile.cs
- IsolatedStorageFileStream.cs
- RewritingValidator.cs
- TabControlCancelEvent.cs
- ConnectionPointCookie.cs
- ConfigurationProperty.cs
- Floater.cs
- ConcurrentStack.cs