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
- UrlMapping.cs
- DesignerContextDescriptor.cs
- Privilege.cs
- DynamicRenderer.cs
- FormViewModeEventArgs.cs
- ProxyOperationRuntime.cs
- InternalPermissions.cs
- Int16AnimationBase.cs
- FilteredAttributeCollection.cs
- ECDiffieHellmanCng.cs
- BinaryParser.cs
- GridViewPageEventArgs.cs
- TemplatedAdorner.cs
- SyndicationLink.cs
- PersistenceTypeAttribute.cs
- FixedPageStructure.cs
- FigureParaClient.cs
- MimePart.cs
- sqlstateclientmanager.cs
- SafeLocalMemHandle.cs
- ArrayElementGridEntry.cs
- SizeAnimationUsingKeyFrames.cs
- JoinTreeSlot.cs
- XmlnsCompatibleWithAttribute.cs
- FixedTextSelectionProcessor.cs
- SlipBehavior.cs
- FlowNode.cs
- SamlAdvice.cs
- ButtonAutomationPeer.cs
- HealthMonitoringSection.cs
- EnvironmentPermission.cs
- VisualBasicReference.cs
- ViewManager.cs
- MethodBuilder.cs
- Vector.cs
- FormViewDeleteEventArgs.cs
- GridViewRowEventArgs.cs
- ColumnMapProcessor.cs
- StylusButtonEventArgs.cs
- SequenceDesignerAccessibleObject.cs
- RegexStringValidatorAttribute.cs
- ObjectSpanRewriter.cs
- AssemblyEvidenceFactory.cs
- FileSystemEventArgs.cs
- XmlHierarchicalDataSourceView.cs
- Helper.cs
- MonthCalendar.cs
- LinkDescriptor.cs
- ControlLocalizer.cs
- OdbcCommand.cs
- BindingObserver.cs
- VectorCollectionConverter.cs
- followingquery.cs
- ExceptionRoutedEventArgs.cs
- SelectionEditor.cs
- NativeMethods.cs
- ContextMenuStripGroupCollection.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- ChannelBinding.cs
- DataTableCollection.cs
- SqlWebEventProvider.cs
- BamlVersionHeader.cs
- DeploymentSection.cs
- MailSettingsSection.cs
- DateTimeFormatInfoScanner.cs
- XmlILConstructAnalyzer.cs
- PeerNameRegistration.cs
- XmlSchemaAnnotation.cs
- GeneralTransform3DGroup.cs
- RegexCapture.cs
- ClientUrlResolverWrapper.cs
- LineInfo.cs
- DictionarySectionHandler.cs
- ToolStripGrip.cs
- XpsThumbnail.cs
- DataGridViewAdvancedBorderStyle.cs
- GiveFeedbackEventArgs.cs
- MenuItem.cs
- DBCommand.cs
- RtfToXamlReader.cs
- ElementMarkupObject.cs
- EmissiveMaterial.cs
- SignedXml.cs
- LazyLoadBehavior.cs
- GenericEnumConverter.cs
- WebPartHelpVerb.cs
- UnionCodeGroup.cs
- MessageQueueEnumerator.cs
- AsymmetricAlgorithm.cs
- FixedPage.cs
- Lookup.cs
- CodeEventReferenceExpression.cs
- ShutDownListener.cs
- WorkflowDurableInstance.cs
- CodeGotoStatement.cs
- CodeDelegateInvokeExpression.cs
- DispatcherObject.cs
- DrawingGroup.cs
- SQLDecimalStorage.cs
- Ticks.cs