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
- SqlCacheDependencySection.cs
- HyperLinkColumn.cs
- Timeline.cs
- securitycriticaldataformultiplegetandset.cs
- EntityDataSourceStatementEditorForm.cs
- FlowLayout.cs
- ArithmeticException.cs
- AffineTransform3D.cs
- ListenerBinder.cs
- TextBreakpoint.cs
- UidManager.cs
- PointCollectionValueSerializer.cs
- StorageComplexTypeMapping.cs
- DynamicDocumentPaginator.cs
- StylusPointCollection.cs
- SqlRewriteScalarSubqueries.cs
- PageSetupDialog.cs
- CheckBoxPopupAdapter.cs
- VariableQuery.cs
- unitconverter.cs
- ConcatQueryOperator.cs
- WebPartTransformerAttribute.cs
- BlobPersonalizationState.cs
- TemplatePropertyEntry.cs
- Rect.cs
- LinqMaximalSubtreeNominator.cs
- NameValuePermission.cs
- FlagsAttribute.cs
- ObjectListCommandsPage.cs
- MulticastOption.cs
- CursorConverter.cs
- EmptyEnumerable.cs
- SingleKeyFrameCollection.cs
- Vector3DKeyFrameCollection.cs
- NetSectionGroup.cs
- BamlRecords.cs
- IsolatedStorageFile.cs
- RuntimeArgument.cs
- PowerStatus.cs
- Math.cs
- AdRotator.cs
- InfoCardXmlSerializer.cs
- DocumentApplication.cs
- KeyboardDevice.cs
- XmlCharCheckingWriter.cs
- Point3D.cs
- MouseGesture.cs
- XPathNavigatorReader.cs
- RecordManager.cs
- HttpCachePolicy.cs
- Utils.cs
- NamespaceEmitter.cs
- XmlDocumentType.cs
- XamlInt32CollectionSerializer.cs
- ErrorFormatterPage.cs
- HttpCacheVaryByContentEncodings.cs
- unitconverter.cs
- WSDualHttpSecurityElement.cs
- BaseValidator.cs
- ExportFileRequest.cs
- EditorZone.cs
- TableLayoutStyleCollection.cs
- CodeIterationStatement.cs
- MethodInfo.cs
- WebServiceParameterData.cs
- MembershipValidatePasswordEventArgs.cs
- DataControlFieldHeaderCell.cs
- DataColumnPropertyDescriptor.cs
- ThicknessKeyFrameCollection.cs
- ArgumentDesigner.xaml.cs
- RangeBaseAutomationPeer.cs
- ComponentResourceKey.cs
- NameObjectCollectionBase.cs
- TextTreeExtractElementUndoUnit.cs
- WinOEToolBoxItem.cs
- ResourcePermissionBaseEntry.cs
- PassportAuthenticationModule.cs
- DefaultPrintController.cs
- SystemNetworkInterface.cs
- PropertyValueChangedEvent.cs
- ConstrainedGroup.cs
- hresults.cs
- KeyFrames.cs
- TdsParameterSetter.cs
- OwnerDrawPropertyBag.cs
- NavigationWindowAutomationPeer.cs
- FragmentQuery.cs
- SimpleHandlerBuildProvider.cs
- DefaultAsyncDataDispatcher.cs
- PageSetupDialog.cs
- RadioButton.cs
- WebPartConnectionsConfigureVerb.cs
- CmsInterop.cs
- DeflateStream.cs
- IWorkflowDebuggerService.cs
- UnmanagedHandle.cs
- SrgsRule.cs
- Qualifier.cs
- WindowsStartMenu.cs
- TextDecorations.cs