Code:
                         / Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Markup / ReaderContextStackData.cs / 1 / ReaderContextStackData.cs
                        
                        
                            /****************************************************************************\ 
*
* File: ReaderContextStackData.cs
*
* Copyright (C) 2003 by Microsoft Corporation.  All rights reserved. 
*
\***************************************************************************/ 
 
using System;
using System.Collections; 
using System.Reflection;
using System.Diagnostics;
namespace System.Windows.Markup 
{
    // Data maintained on the reader's context stack.  The root of the tree is at the bottom 
    // of the stack. 
    internal class ReaderContextStackData
    { 
        //
        // NOTE:  If you add a field here, be sure to update ClearData
        // 
        ReaderFlags  _contextFlags;
        object       _contextData; 
        object       _contextKey; 
        string        _uid;
        string        _name; 
        object       _contentProperty;
        Type         _expectedType;
        short        _expectedTypeId;
        bool         _createUsingTypeConverter; 
        //
        // NOTE:  If you add a field here, be sure to update ClearData 
        // 
 
        // Returns just the part of the flags field corresponding to the context type
        internal ReaderFlags ContextType 
        {
            get { return (ReaderFlags)(_contextFlags & ReaderFlags.ContextTypeMask); } 
        } 
        // The data object for this point in the stack.  Typically the element at 
        // this scoping level
        internal object ObjectData
        {
            get { return _contextData; } 
            set { _contextData = value; }
        } 
 
        // The key attribute defined for the current context, whose parent context is expected
        // to be an IDictionary 
        internal object Key
        {
            get { return _contextKey; }
            set { _contextKey = value; } 
        }
 
        // The x:Uid of this object, if it has one and has been read yet. 
        internal string Uid
        { 
            get { return _uid; }
            set { _uid = value; }
        }
 
        // The x:Name (or Name) of this object, if it has one and has been read yet.
        // Alternatively if this context object represents a property this member 
        // gives you the name of the property. This is used to find a fallback value 
        // for this property in the event of an exception during property parsing.
        internal string ElementNameOrPropertyName 
        {
            get { return _name; }
            set { _name = value; }
        } 
        internal object ContentProperty 
        { 
            get { return _contentProperty; }
            set { _contentProperty = value; } 
        }
        // If an object has not yet been created at this point, this is the type of
        // element to created 
        internal Type ExpectedType
        { 
            get { return _expectedType; } 
            set { _expectedType = value; }
        } 
        // If an object has not yet been created at this point, this is the Baml type id
        // of the element.  This is used for faster creation of known types.
        internal short ExpectedTypeId 
        {
            get { return _expectedTypeId; } 
            set { _expectedTypeId = value; } 
        }
 
        // This object is expected to be created using a TypeConverter.  If this
        //  is true, the following are also expected to be true:
        // -ObjectData is null
        // -ExpectedType is non-null 
        // -ExpectedTypeId is non-null
        internal bool CreateUsingTypeConverter 
        { 
            get { return _createUsingTypeConverter; }
            set { _createUsingTypeConverter = value; } 
        }
        // Context identifying what this reader stack item represents
        internal ReaderFlags ContextFlags 
        {
            get { return _contextFlags; } 
            set { _contextFlags = value; } 
        }
 
        // True if this element has not yet been added to the tree, but needs to be.
        internal bool NeedToAddToTree
        {
            get { return CheckFlag(ReaderFlags.NeedToAddToTree); } 
        }
 
        // simple helper method to remove the NeedToAddToTree flag and add the AddedToTree flag 
        internal void MarkAddedToTree()
        { 
            ContextFlags = ((ContextFlags | ReaderFlags.AddedToTree) & ~ReaderFlags.NeedToAddToTree);
        }
        // simple helper method that returns true if the context contains the given flag or flags. 
        // If multiple flags are passed in, the context must contain all the flags.
        internal bool CheckFlag(ReaderFlags flag) 
        { 
            return (ContextFlags & flag) == flag;
        } 
        // simple helper method adds the flag to the context
        internal void SetFlag(ReaderFlags flag)
        { 
            ContextFlags |= flag;
        } 
 
        // simple helper method that removes the flag from the context
        internal void ClearFlag(ReaderFlags flag) 
        {
            ContextFlags &= ~flag;
        }
 
        // Helper to determine if this represents an object element.
        internal bool IsObjectElement 
        { 
            get
            { 
                return ContextType == ReaderFlags.DependencyObject
                       ||
                       ContextType == ReaderFlags.ClrObject;
            } 
        }
 
        // Clear all the fields on this instance before it put into the factory cache 
        internal void ClearData()
        { 
            _contextFlags = 0;
            _contextData = null;
            _contextKey = null;
            _contentProperty = null; 
            _expectedType = null;
            _expectedTypeId = 0; 
            _createUsingTypeConverter = false; 
            _uid = null;
            _name = null; 
        }
    }
 
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
/****************************************************************************\ 
*
* File: ReaderContextStackData.cs
*
* Copyright (C) 2003 by Microsoft Corporation.  All rights reserved. 
*
\***************************************************************************/ 
 
using System;
using System.Collections; 
using System.Reflection;
using System.Diagnostics;
namespace System.Windows.Markup 
{
    // Data maintained on the reader's context stack.  The root of the tree is at the bottom 
    // of the stack. 
    internal class ReaderContextStackData
    { 
        //
        // NOTE:  If you add a field here, be sure to update ClearData
        // 
        ReaderFlags  _contextFlags;
        object       _contextData; 
        object       _contextKey; 
        string        _uid;
        string        _name; 
        object       _contentProperty;
        Type         _expectedType;
        short        _expectedTypeId;
        bool         _createUsingTypeConverter; 
        //
        // NOTE:  If you add a field here, be sure to update ClearData 
        // 
 
        // Returns just the part of the flags field corresponding to the context type
        internal ReaderFlags ContextType 
        {
            get { return (ReaderFlags)(_contextFlags & ReaderFlags.ContextTypeMask); } 
        } 
        // The data object for this point in the stack.  Typically the element at 
        // this scoping level
        internal object ObjectData
        {
            get { return _contextData; } 
            set { _contextData = value; }
        } 
 
        // The key attribute defined for the current context, whose parent context is expected
        // to be an IDictionary 
        internal object Key
        {
            get { return _contextKey; }
            set { _contextKey = value; } 
        }
 
        // The x:Uid of this object, if it has one and has been read yet. 
        internal string Uid
        { 
            get { return _uid; }
            set { _uid = value; }
        }
 
        // The x:Name (or Name) of this object, if it has one and has been read yet.
        // Alternatively if this context object represents a property this member 
        // gives you the name of the property. This is used to find a fallback value 
        // for this property in the event of an exception during property parsing.
        internal string ElementNameOrPropertyName 
        {
            get { return _name; }
            set { _name = value; }
        } 
        internal object ContentProperty 
        { 
            get { return _contentProperty; }
            set { _contentProperty = value; } 
        }
        // If an object has not yet been created at this point, this is the type of
        // element to created 
        internal Type ExpectedType
        { 
            get { return _expectedType; } 
            set { _expectedType = value; }
        } 
        // If an object has not yet been created at this point, this is the Baml type id
        // of the element.  This is used for faster creation of known types.
        internal short ExpectedTypeId 
        {
            get { return _expectedTypeId; } 
            set { _expectedTypeId = value; } 
        }
 
        // This object is expected to be created using a TypeConverter.  If this
        //  is true, the following are also expected to be true:
        // -ObjectData is null
        // -ExpectedType is non-null 
        // -ExpectedTypeId is non-null
        internal bool CreateUsingTypeConverter 
        { 
            get { return _createUsingTypeConverter; }
            set { _createUsingTypeConverter = value; } 
        }
        // Context identifying what this reader stack item represents
        internal ReaderFlags ContextFlags 
        {
            get { return _contextFlags; } 
            set { _contextFlags = value; } 
        }
 
        // True if this element has not yet been added to the tree, but needs to be.
        internal bool NeedToAddToTree
        {
            get { return CheckFlag(ReaderFlags.NeedToAddToTree); } 
        }
 
        // simple helper method to remove the NeedToAddToTree flag and add the AddedToTree flag 
        internal void MarkAddedToTree()
        { 
            ContextFlags = ((ContextFlags | ReaderFlags.AddedToTree) & ~ReaderFlags.NeedToAddToTree);
        }
        // simple helper method that returns true if the context contains the given flag or flags. 
        // If multiple flags are passed in, the context must contain all the flags.
        internal bool CheckFlag(ReaderFlags flag) 
        { 
            return (ContextFlags & flag) == flag;
        } 
        // simple helper method adds the flag to the context
        internal void SetFlag(ReaderFlags flag)
        { 
            ContextFlags |= flag;
        } 
 
        // simple helper method that removes the flag from the context
        internal void ClearFlag(ReaderFlags flag) 
        {
            ContextFlags &= ~flag;
        }
 
        // Helper to determine if this represents an object element.
        internal bool IsObjectElement 
        { 
            get
            { 
                return ContextType == ReaderFlags.DependencyObject
                       ||
                       ContextType == ReaderFlags.ClrObject;
            } 
        }
 
        // Clear all the fields on this instance before it put into the factory cache 
        internal void ClearData()
        { 
            _contextFlags = 0;
            _contextData = null;
            _contextKey = null;
            _contentProperty = null; 
            _expectedType = null;
            _expectedTypeId = 0; 
            _createUsingTypeConverter = false; 
            _uid = null;
            _name = null; 
        }
    }
 
}
// 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
- HandlerBase.cs
- OutputCacheSettingsSection.cs
- Int32Rect.cs
- SecurityCriticalDataForSet.cs
- TableStyle.cs
- CrossSiteScriptingValidation.cs
- UrlMappingsSection.cs
- FtpWebRequest.cs
- SafeSecurityHelper.cs
- OperationAbortedException.cs
- PartialTrustVisibleAssembliesSection.cs
- SchemaComplexType.cs
- Composition.cs
- PersistenceIOParticipant.cs
- NotifyCollectionChangedEventArgs.cs
- Part.cs
- UnsafeCollabNativeMethods.cs
- DataGridViewToolTip.cs
- HtmlImage.cs
- Parameter.cs
- ApplicationDirectoryMembershipCondition.cs
- _FixedSizeReader.cs
- RichTextBox.cs
- compensatingcollection.cs
- PathParser.cs
- Timeline.cs
- SmiMetaData.cs
- RadioButtonPopupAdapter.cs
- XmlSchemaComplexType.cs
- SamlConstants.cs
- EllipseGeometry.cs
- ObjectTag.cs
- Padding.cs
- MobileControlsSectionHelper.cs
- ImageIndexConverter.cs
- SystemIPGlobalStatistics.cs
- DataGridRow.cs
- ExternalException.cs
- QueryRewriter.cs
- HitTestFilterBehavior.cs
- xmlfixedPageInfo.cs
- Queue.cs
- DBCommand.cs
- _NtlmClient.cs
- XslTransform.cs
- WsiProfilesElement.cs
- WorkflowServiceHostFactory.cs
- TreeChangeInfo.cs
- FixedSOMLineRanges.cs
- TextDecorationCollection.cs
- columnmapfactory.cs
- Regex.cs
- WindowsContainer.cs
- HttpRuntimeSection.cs
- TextRangeBase.cs
- DEREncoding.cs
- BamlReader.cs
- FixedSOMImage.cs
- WCFBuildProvider.cs
- FontStyles.cs
- ClonableStack.cs
- MethodBuilderInstantiation.cs
- SqlDataSourceCache.cs
- WebPartCloseVerb.cs
- ActivityTypeCodeDomSerializer.cs
- DefaultBindingPropertyAttribute.cs
- GeneralTransform.cs
- ColumnResizeAdorner.cs
- XmlQueryStaticData.cs
- DataServiceHostFactory.cs
- ModelEditingScope.cs
- RowTypePropertyElement.cs
- UpdateCompiler.cs
- OleStrCAMarshaler.cs
- HierarchicalDataBoundControlAdapter.cs
- CroppedBitmap.cs
- TraceEventCache.cs
- MetadataItemSerializer.cs
- Matrix3DConverter.cs
- SafeCryptoHandles.cs
- TableLayoutStyleCollection.cs
- HttpCapabilitiesBase.cs
- Renderer.cs
- DataGridViewCellStyle.cs
- AncestorChangedEventArgs.cs
- DataGridViewAddColumnDialog.cs
- LifetimeServices.cs
- Container.cs
- HelpInfo.cs
- ButtonBase.cs
- uribuilder.cs
- DockPatternIdentifiers.cs
- CharStorage.cs
- WebPartDescription.cs
- StorageAssociationTypeMapping.cs
- Table.cs
- DataViewManager.cs
- ContextMenuAutomationPeer.cs
- TextContainer.cs
- SendActivityDesignerTheme.cs