XamlStyleSerializer.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Markup / XamlStyleSerializer.cs / 1 / XamlStyleSerializer.cs

                            //---------------------------------------------------------------------------- 
//
// File: XamlStyleSerializer.cs
//
// Description: 
//   Class that serializes and deserializes Styles.
// 
// Copyright (C) 2003 by Microsoft Corporation.  All rights reserved. 
//
//--------------------------------------------------------------------------- 

using System;
using System.ComponentModel;
 
using System.ComponentModel.Design.Serialization;
using System.Diagnostics; 
using System.Collections; 
using System.Globalization;
using System.IO; 
using System.Reflection;
using System.Text;
using System.Xml;
using System.Security.Permissions; 
using MS.Utility;
 
#if !PBTCOMPILER 
using System.Windows.Data;
#endif 

#if PBTCOMPILER
namespace MS.Internal.Markup
#else 
namespace System.Windows.Markup
#endif 
{ 
    /// 
    ///     Class that knows how to serialize and deserialize Style objects 
    /// 
    internal class XamlStyleSerializer : XamlSerializer
    {
        #region Construction 

        ///  
        ///     Constructor for XamlStyleSerializer 
        /// 
        public XamlStyleSerializer() : base() 
        {
        }

        internal XamlStyleSerializer(ParserHooks parserHooks) : base() 
        {
            _parserHooks = parserHooks; 
        } 

        #endregion Construction 

        #region OtherConversions

        ///  
        ///   Convert from Xaml read by a token reader into baml being written
        ///   out by a record writer.  The context gives mapping information. 
        ///  
#if !PBTCOMPILER
        //CASRemoval:[StrongNameIdentityPermission(SecurityAction.InheritanceDemand, PublicKey = Microsoft.Internal.BuildInfo.WCP_PUBLIC_KEY_STRING)] 
#endif
        internal override void ConvertXamlToBaml (
            XamlReaderHelper             tokenReader,
            ParserContext          context, 
            XamlNode               xamlNode,
            BamlRecordWriter       bamlWriter) 
        { 
            StyleXamlParser styleParser = new StyleXamlParser(tokenReader, context);
            styleParser.BamlRecordWriter = bamlWriter; 
            styleParser.ParserHooks = _parserHooks;


            // Process the xamlNode that is passed in so that the