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
- LicenseManager.cs
- Operand.cs
- TypedTableBase.cs
- GiveFeedbackEvent.cs
- InputMethodStateChangeEventArgs.cs
- FirstMatchCodeGroup.cs
- NavigationService.cs
- MappingMetadataHelper.cs
- EdmToObjectNamespaceMap.cs
- FrameworkElementAutomationPeer.cs
- BindingElementCollection.cs
- CodeRegionDirective.cs
- ReceiveActivityDesignerTheme.cs
- NavigationPropertySingletonExpression.cs
- CallbackHandler.cs
- Validator.cs
- CompilerScopeManager.cs
- ColorContextHelper.cs
- ObjRef.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- CodePageEncoding.cs
- LineVisual.cs
- ButtonAutomationPeer.cs
- RegisteredHiddenField.cs
- MSAAWinEventWrap.cs
- BitHelper.cs
- WebPartsPersonalizationAuthorization.cs
- CopyAction.cs
- CaretElement.cs
- TypeHelper.cs
- HtmlGenericControl.cs
- SqlDataSourceParameterParser.cs
- ContentDisposition.cs
- StorageMappingItemCollection.cs
- CopyNodeSetAction.cs
- Regex.cs
- PrintDialog.cs
- WindowsSolidBrush.cs
- CompositeScriptReference.cs
- BrushConverter.cs
- SettingsPropertyCollection.cs
- XmlTextEncoder.cs
- StyleSheetRefUrlEditor.cs
- OleCmdHelper.cs
- IteratorFilter.cs
- TearOffProxy.cs
- FunctionImportElement.cs
- BaseValidator.cs
- _DigestClient.cs
- ListView.cs
- AttributeCollection.cs
- AssociationTypeEmitter.cs
- OleDbInfoMessageEvent.cs
- XmlExpressionDumper.cs
- ModulesEntry.cs
- HtmlListAdapter.cs
- DataTableReader.cs
- SqlBuilder.cs
- Pool.cs
- Attributes.cs
- ClientUrlResolverWrapper.cs
- TypeBuilder.cs
- Expander.cs
- TextParagraphProperties.cs
- ConfigXmlAttribute.cs
- RadioButtonBaseAdapter.cs
- DelegatedStream.cs
- BuildManager.cs
- HyperlinkAutomationPeer.cs
- TableLayoutSettings.cs
- ReliableReplySessionChannel.cs
- PageContent.cs
- DataControlButton.cs
- CodeLinePragma.cs
- Debug.cs
- SqlEnums.cs
- FrameworkTemplate.cs
- XmlAttributeHolder.cs
- AmbientLight.cs
- ObjectRef.cs
- InputProviderSite.cs
- DayRenderEvent.cs
- SerializableAttribute.cs
- SizeAnimationClockResource.cs
- PartialCachingControl.cs
- xsdvalidator.cs
- WindowsHyperlink.cs
- EntryPointNotFoundException.cs
- TimeoutStream.cs
- CollectionBuilder.cs
- PrivilegeNotHeldException.cs
- String.cs
- WebPartAddingEventArgs.cs
- ItemList.cs
- ImageMap.cs
- SafeNativeMethods.cs
- DataGridViewAdvancedBorderStyle.cs
- RuleInfoComparer.cs
- FileDialogCustomPlaces.cs
- LinqToSqlWrapper.cs