Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Markup / XamlDesignerSerializationManager.cs / 1 / 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
- LinearKeyFrames.cs
- MouseCaptureWithinProperty.cs
- ImplicitInputBrush.cs
- KeyPressEvent.cs
- Image.cs
- TextTrailingWordEllipsis.cs
- TextPointer.cs
- Int16Converter.cs
- WizardStepBase.cs
- EditorPartCollection.cs
- AuthenticationException.cs
- StringAnimationUsingKeyFrames.cs
- GeometryGroup.cs
- DbBuffer.cs
- ResXResourceWriter.cs
- SamlSecurityTokenAuthenticator.cs
- TreeView.cs
- SortExpressionBuilder.cs
- uribuilder.cs
- ISAPIWorkerRequest.cs
- ViewManager.cs
- ModelUIElement3D.cs
- HtmlInputSubmit.cs
- SegmentInfo.cs
- EntityCommandDefinition.cs
- DictionarySectionHandler.cs
- SqlDataReaderSmi.cs
- DecoderFallback.cs
- XmlSchemaCollection.cs
- UInt32Converter.cs
- RoutedEventHandlerInfo.cs
- ServiceHostFactory.cs
- CharUnicodeInfo.cs
- AsyncResult.cs
- TableLayoutCellPaintEventArgs.cs
- EventWaitHandle.cs
- WebPartChrome.cs
- Geometry3D.cs
- ExtendedProtectionPolicy.cs
- prompt.cs
- BooleanFunctions.cs
- TextParagraph.cs
- LogWriteRestartAreaState.cs
- SmtpDigestAuthenticationModule.cs
- ProjectionAnalyzer.cs
- DesignerTransactionCloseEvent.cs
- GeneralTransform3DCollection.cs
- DiagnosticSection.cs
- PerfCounterSection.cs
- Errors.cs
- AttributeCollection.cs
- SqlDataSourceCache.cs
- FtpWebResponse.cs
- MenuItemStyleCollectionEditor.cs
- TdsParserStateObject.cs
- reliableinputsessionchannel.cs
- BitStack.cs
- ConstNode.cs
- SafeNativeMethodsOther.cs
- MetadataPropertyAttribute.cs
- CodeParameterDeclarationExpression.cs
- WebPartMenu.cs
- LayoutSettings.cs
- SingleTagSectionHandler.cs
- unsafeIndexingFilterStream.cs
- Error.cs
- QueryableDataSourceHelper.cs
- TypeListConverter.cs
- SystemIPv6InterfaceProperties.cs
- ThreadStaticAttribute.cs
- PackageDigitalSignature.cs
- SqlTransaction.cs
- BuildProvidersCompiler.cs
- _ShellExpression.cs
- ImportedPolicyConversionContext.cs
- DataGridViewCellStateChangedEventArgs.cs
- Int64KeyFrameCollection.cs
- ConfigurationSection.cs
- MatrixTransform.cs
- ToolBarButton.cs
- ProgressBarBrushConverter.cs
- RuntimeHelpers.cs
- DataGridViewCellParsingEventArgs.cs
- SafeNativeMethods.cs
- SessionPageStatePersister.cs
- LoopExpression.cs
- RequestCachePolicy.cs
- PropertyNames.cs
- DesignOnlyAttribute.cs
- XMLDiffLoader.cs
- CodeIdentifier.cs
- UserPreferenceChangedEventArgs.cs
- FormConverter.cs
- TableSectionStyle.cs
- XmlUrlResolver.cs
- CacheEntry.cs
- Metafile.cs
- XNodeNavigator.cs
- AssemblyInfo.cs
- ProviderConnectionPoint.cs