Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / XamlDesignerSerializationManager.cs / 1305600 / XamlDesignerSerializationManager.cs
//---------------------------------------------------------------------------- // // File: XamlDesignerSerializationManager.cs // // Description: // Manages the ContextStack for a particular run of Serialization. // // Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Reflection; using System.Xml; namespace System.Windows.Markup { ////// The serialization manager offers three services /// 1. To store all of the context information /// for the current run of serialization on a stack. /// 2. To query a given type for its serializer. /// 3. To get and set the serialization mode for /// a given Expression type /// ////// As a measure of optimization it also /// maintains a cache mapping types to /// serializers, to avoid the overhead of /// reflecting for the attribute on every /// query. /// /// /// // public class XamlDesignerSerializationManager : ServiceProviders { #region Construction ////// Constructor for XamlDesignerSerializationManager /// /// /// XmlWriter /// public XamlDesignerSerializationManager(XmlWriter xmlWriter) { _xamlWriterMode = XamlWriterMode.Value; _xmlWriter = xmlWriter; } #endregion Construction #region Properties ////// The mode of serialization for /// all Expressions /// public XamlWriterMode XamlWriterMode { get { return _xamlWriterMode; } set { // Validate Input Arguments if (!IsValidXamlWriterMode(value)) { throw new InvalidEnumArgumentException("value", (int)value, typeof(XamlWriterMode)); } _xamlWriterMode = value; } } ////// XmlWriter /// internal XmlWriter XmlWriter { get { return _xmlWriter; } } #endregion Properties #region Internal Methods internal void ClearXmlWriter() { _xmlWriter = null; } #endregion #region Private Methods private static bool IsValidXamlWriterMode(XamlWriterMode value) { return value == XamlWriterMode.Value || value == XamlWriterMode.Expression; } #endregion #region Data private XamlWriterMode _xamlWriterMode; // Serialization modes private XmlWriter _xmlWriter; //XmlWriter #endregion Data } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: XamlDesignerSerializationManager.cs // // Description: // Manages the ContextStack for a particular run of Serialization. // // Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Reflection; using System.Xml; namespace System.Windows.Markup { ////// The serialization manager offers three services /// 1. To store all of the context information /// for the current run of serialization on a stack. /// 2. To query a given type for its serializer. /// 3. To get and set the serialization mode for /// a given Expression type /// ////// As a measure of optimization it also /// maintains a cache mapping types to /// serializers, to avoid the overhead of /// reflecting for the attribute on every /// query. /// /// /// // public class XamlDesignerSerializationManager : ServiceProviders { #region Construction ////// Constructor for XamlDesignerSerializationManager /// /// /// XmlWriter /// public XamlDesignerSerializationManager(XmlWriter xmlWriter) { _xamlWriterMode = XamlWriterMode.Value; _xmlWriter = xmlWriter; } #endregion Construction #region Properties ////// The mode of serialization for /// all Expressions /// public XamlWriterMode XamlWriterMode { get { return _xamlWriterMode; } set { // Validate Input Arguments if (!IsValidXamlWriterMode(value)) { throw new InvalidEnumArgumentException("value", (int)value, typeof(XamlWriterMode)); } _xamlWriterMode = value; } } ////// XmlWriter /// internal XmlWriter XmlWriter { get { return _xmlWriter; } } #endregion Properties #region Internal Methods internal void ClearXmlWriter() { _xmlWriter = null; } #endregion #region Private Methods private static bool IsValidXamlWriterMode(XamlWriterMode value) { return value == XamlWriterMode.Value || value == XamlWriterMode.Expression; } #endregion #region Data private XamlWriterMode _xamlWriterMode; // Serialization modes private XmlWriter _xmlWriter; //XmlWriter #endregion Data } } // 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
- RuleDefinitions.cs
- ViewManager.cs
- XmlDataDocument.cs
- UriTemplateTrieLocation.cs
- UriExt.cs
- DeferrableContent.cs
- StringExpressionSet.cs
- DefaultBindingPropertyAttribute.cs
- SettingsProviderCollection.cs
- Rotation3D.cs
- ExpressionBuilderCollection.cs
- CodeTypeOfExpression.cs
- AutoResetEvent.cs
- ChildrenQuery.cs
- SmtpReplyReaderFactory.cs
- WaitHandle.cs
- ProtocolInformationReader.cs
- IdentityModelDictionary.cs
- CSharpCodeProvider.cs
- NotImplementedException.cs
- DataSourceCache.cs
- SerializationSectionGroup.cs
- MenuAdapter.cs
- NameObjectCollectionBase.cs
- ItemType.cs
- MappingItemCollection.cs
- DataBindingHandlerAttribute.cs
- OptimisticConcurrencyException.cs
- PrintEvent.cs
- XmlNodeComparer.cs
- ImageIndexEditor.cs
- PageDeviceFont.cs
- NavigationCommands.cs
- _ConnectOverlappedAsyncResult.cs
- ForceCopyBuildProvider.cs
- InstanceLockLostException.cs
- LinearGradientBrush.cs
- TemplatePagerField.cs
- ResourceAttributes.cs
- ButtonField.cs
- ApplicationCommands.cs
- Transform.cs
- IntranetCredentialPolicy.cs
- DesignerToolStripControlHost.cs
- Tokenizer.cs
- ObjectDataSourceDesigner.cs
- Encoder.cs
- AssemblyGen.cs
- XmlArrayItemAttributes.cs
- UserPersonalizationStateInfo.cs
- TextProperties.cs
- _ConnectStream.cs
- NativeCompoundFileAPIs.cs
- ProfessionalColorTable.cs
- ObjectStorage.cs
- EndCreateSecurityTokenRequest.cs
- XmlMemberMapping.cs
- MatcherBuilder.cs
- HtmlHistory.cs
- X509CertificateTrustedIssuerElementCollection.cs
- SamlAction.cs
- PrinterUnitConvert.cs
- DebugView.cs
- EntityDataSourceColumn.cs
- TrackingServices.cs
- AnonymousIdentificationModule.cs
- InvokeWebServiceDesigner.cs
- AppDomainFactory.cs
- HMACSHA1.cs
- GridViewColumn.cs
- CodeVariableDeclarationStatement.cs
- OdbcCommandBuilder.cs
- QilGenerator.cs
- LocationSectionRecord.cs
- StorageEntityTypeMapping.cs
- FixUpCollection.cs
- ItemCheckedEvent.cs
- RoleManagerEventArgs.cs
- ExportException.cs
- EntitySqlException.cs
- SurrogateEncoder.cs
- CheckoutException.cs
- CallId.cs
- AttributeAction.cs
- ReferenceConverter.cs
- GuidConverter.cs
- XmlTextReader.cs
- EntitySet.cs
- UserNamePasswordServiceCredential.cs
- XmlMembersMapping.cs
- Vector3DAnimationUsingKeyFrames.cs
- SoapTypeAttribute.cs
- TextServicesLoader.cs
- SemanticBasicElement.cs
- PropertyInformationCollection.cs
- Matrix.cs
- IDReferencePropertyAttribute.cs
- ColorTransformHelper.cs
- RenderingEventArgs.cs
- MdiWindowListStrip.cs