Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- SystemException.cs
- DataMemberFieldEditor.cs
- Maps.cs
- FontStyleConverter.cs
- ValidationSummary.cs
- ProcessMessagesAsyncResult.cs
- DBConcurrencyException.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- IndexingContentUnit.cs
- BitmapCache.cs
- DataListCommandEventArgs.cs
- TextBoxDesigner.cs
- _SslStream.cs
- DataSourceControl.cs
- FilterableAttribute.cs
- ActionFrame.cs
- EnumType.cs
- FontWeight.cs
- ByeOperationCD1AsyncResult.cs
- FontStyleConverter.cs
- PersonalizationStateInfoCollection.cs
- ConfigXmlText.cs
- MachineKeyValidationConverter.cs
- TextAnchor.cs
- CharacterShapingProperties.cs
- SoapSchemaMember.cs
- EventBuilder.cs
- ServiceControllerDesigner.cs
- LambdaCompiler.Address.cs
- Attributes.cs
- PassportAuthentication.cs
- PersonalizationAdministration.cs
- CompositionCommandSet.cs
- SafeHandles.cs
- SHA384.cs
- ConfigurationFileMap.cs
- DataViewSettingCollection.cs
- MultipleViewPattern.cs
- EventArgs.cs
- AlignmentYValidation.cs
- IntPtr.cs
- FontNamesConverter.cs
- ObjectView.cs
- SafeNativeMethodsOther.cs
- xdrvalidator.cs
- TemplateXamlParser.cs
- SurrogateChar.cs
- ExtensionDataReader.cs
- ISAPIWorkerRequest.cs
- HtmlObjectListAdapter.cs
- ApplicationId.cs
- EntityViewContainer.cs
- AttachedAnnotationChangedEventArgs.cs
- DecimalKeyFrameCollection.cs
- AppDomainManager.cs
- ChameleonKey.cs
- WindowsEditBox.cs
- ClientSideProviderDescription.cs
- Signature.cs
- RowUpdatingEventArgs.cs
- RowToFieldTransformer.cs
- OptimalTextSource.cs
- DoubleLinkList.cs
- LineGeometry.cs
- CustomCredentialPolicy.cs
- CompositeDuplexBindingElement.cs
- FacetValues.cs
- TextWriter.cs
- ContentDisposition.cs
- Vector3D.cs
- XmlSchemaExternal.cs
- XamlReader.cs
- TimelineCollection.cs
- SqlParameterizer.cs
- LiteralText.cs
- Cursor.cs
- MenuItemStyle.cs
- HttpModulesSection.cs
- ContractNamespaceAttribute.cs
- MetadataUtil.cs
- TaiwanLunisolarCalendar.cs
- XmlDataSourceNodeDescriptor.cs
- FixedSOMPage.cs
- Menu.cs
- PartialArray.cs
- DesignOnlyAttribute.cs
- AuthenticationService.cs
- XmlTypeMapping.cs
- CompletionProxy.cs
- VisualStyleTypesAndProperties.cs
- TextServicesDisplayAttribute.cs
- ArgumentReference.cs
- DefaultValidator.cs
- DebugHandleTracker.cs
- RectIndependentAnimationStorage.cs
- TripleDES.cs
- TakeQueryOptionExpression.cs
- Vars.cs
- HierarchicalDataBoundControlAdapter.cs
- IODescriptionAttribute.cs