Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / Design / Serialization / DesignerSerializerAttribute.cs / 1 / DesignerSerializerAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.ComponentModel.Design.Serialization {
using System.Security.Permissions;
///
/// This attribute can be placed on a class to indicate what serialization
/// object should be used to serialize the class at design time.
///
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)]
public sealed class DesignerSerializerAttribute : Attribute {
private string serializerTypeName;
private string serializerBaseTypeName;
private string typeId;
///
/// Creates a new designer serialization attribute.
///
public DesignerSerializerAttribute(Type serializerType, Type baseSerializerType) {
this.serializerTypeName = serializerType.AssemblyQualifiedName;
this.serializerBaseTypeName = baseSerializerType.AssemblyQualifiedName;
}
///
/// Creates a new designer serialization attribute.
///
public DesignerSerializerAttribute(string serializerTypeName, Type baseSerializerType) {
this.serializerTypeName = serializerTypeName;
this.serializerBaseTypeName = baseSerializerType.AssemblyQualifiedName;
}
///
/// Creates a new designer serialization attribute.
///
public DesignerSerializerAttribute(string serializerTypeName, string baseSerializerTypeName) {
this.serializerTypeName = serializerTypeName;
this.serializerBaseTypeName = baseSerializerTypeName;
}
///
/// Retrieves the fully qualified type name of the serializer.
///
public string SerializerTypeName {
get {
return serializerTypeName;
}
}
///
/// Retrieves the fully qualified type name of the serializer base type.
///
public string SerializerBaseTypeName {
get {
return serializerBaseTypeName;
}
}
///
///
///
/// This defines a unique ID for this attribute type. It is used
/// by filtering algorithms to identify two attributes that are
/// the same type. For most attributes, this just returns the
/// Type instance for the attribute. EditorAttribute overrides
/// this to include the type of the editor base type.
///
///
public override object TypeId {
get {
if (typeId == null) {
string baseType = serializerBaseTypeName;
int comma = baseType.IndexOf(',');
if (comma != -1) {
baseType = baseType.Substring(0, comma);
}
typeId = GetType().FullName + baseType;
}
return typeId;
}
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IISUnsafeMethods.cs
- MaskInputRejectedEventArgs.cs
- GridViewColumnHeader.cs
- GeneralTransformCollection.cs
- ComponentEditorPage.cs
- Vector3D.cs
- InstalledVoice.cs
- DataGridViewCellConverter.cs
- UserPreferenceChangingEventArgs.cs
- TrackingQueryElement.cs
- Configuration.cs
- XmlWhitespace.cs
- QuerySettings.cs
- NativeMethods.cs
- AttributeEmitter.cs
- ApplyTemplatesAction.cs
- FormsAuthenticationModule.cs
- DragDeltaEventArgs.cs
- OrderByQueryOptionExpression.cs
- ItemsPresenter.cs
- XamlTypeMapper.cs
- XmlSchemaInferenceException.cs
- RegexInterpreter.cs
- UnicodeEncoding.cs
- TrackingMemoryStream.cs
- Size.cs
- TemplateFactory.cs
- RequestValidator.cs
- AssertSection.cs
- FlowLayoutPanel.cs
- SystemIcmpV6Statistics.cs
- WebServiceBindingAttribute.cs
- PermissionSet.cs
- MSHTMLHostUtil.cs
- TransactionScopeDesigner.cs
- ArrayElementGridEntry.cs
- ConfigurationProperty.cs
- ChannelManagerBase.cs
- Timer.cs
- nulltextnavigator.cs
- FieldMetadata.cs
- PreservationFileWriter.cs
- DataGridViewButtonColumn.cs
- XmlNamedNodeMap.cs
- SuppressMergeCheckAttribute.cs
- AncestorChangedEventArgs.cs
- XmlElementAttributes.cs
- GridViewAutoFormat.cs
- ChannelProtectionRequirements.cs
- ChannelToken.cs
- HtmlTextArea.cs
- EntityCommandCompilationException.cs
- BuildProvidersCompiler.cs
- ChameleonKey.cs
- BaseUriWithWildcard.cs
- Int32.cs
- FactoryGenerator.cs
- XmlTextReader.cs
- XsltArgumentList.cs
- NumericExpr.cs
- WebPartCancelEventArgs.cs
- UrlPath.cs
- PoisonMessageException.cs
- XPathNodeHelper.cs
- RootBrowserWindowAutomationPeer.cs
- DataRowCollection.cs
- Select.cs
- AuthenticatedStream.cs
- XPathSelfQuery.cs
- MarshalByRefObject.cs
- SHA256Managed.cs
- NameSpaceEvent.cs
- SmiEventSink_Default.cs
- WindowsFont.cs
- NavigationWindow.cs
- Stacktrace.cs
- FileReservationCollection.cs
- ErrorFormatter.cs
- Sql8ExpressionRewriter.cs
- Int16KeyFrameCollection.cs
- ViewgenContext.cs
- VectorCollectionValueSerializer.cs
- SoapAttributeOverrides.cs
- DataGridHeaderBorder.cs
- AliasedSlot.cs
- SelectedPathEditor.cs
- ContextQuery.cs
- _AuthenticationState.cs
- TypeSemantics.cs
- TemplateBuilder.cs
- SqlAliasesReferenced.cs
- ComplexTypeEmitter.cs
- PolicyManager.cs
- BitmapPalettes.cs
- CssStyleCollection.cs
- EllipseGeometry.cs
- SqlDataSourceQuery.cs
- RoleGroupCollection.cs
- ResourceExpressionBuilder.cs
- RequestDescription.cs