Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Markup / StyleModeStack.cs / 1 / StyleModeStack.cs
using System; using System.Xml; using System.IO; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; #if PBTCOMPILER namespace MS.Internal.Markup #else namespace System.Windows.Markup #endif { internal enum StyleMode : byte { Base, // Style/Template tag, simple and top level complex properties TargetTypeProperty, // Target type complex property under a Style/Template BasedOnProperty, // BasedOn complex property under a Style/Template DataTypeProperty, // Data type complex property under a Template ComplexProperty, // Reading an allowed complex property under a Template Resources, // Resources complex property under a Style Setters, // Style.Setters IList complex property and subtree Key, // x:Key subtree when Style is used in a dictionary TriggerBase, // Style.TriggerBase complex property and subtree TriggerActions, // When in the middle of parsing EventTrigger.TriggerActions TriggerSetters, // When in the middle of parsing property trigger Setters collection TriggerEnterExitActions, // Trigger.EnterActions or Trigger.ExitActions VisualTree, // FrameworkTemplate.VisualTree's subtree } internal class StyleModeStack { internal StyleModeStack() { Push(StyleMode.Base); } internal int Depth { get { return _stack.Count - 1; } } internal StyleMode Mode { get { Debug.Assert(Depth >= 0, "StyleModeStack's depth was " + Depth + ", should be >= 0"); return _stack.Peek(); } } internal void Push (StyleMode mode) { _stack.Push(mode); } internal void Push () { Push(Mode); } internal StyleMode Pop() { Debug.Assert(Depth >= 0, "StyleMode::Pop() with depth of " + Depth + ", should be >= 0"); return _stack.Pop(); } private Stack_stack = new Stack (64); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Xml; using System.IO; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; #if PBTCOMPILER namespace MS.Internal.Markup #else namespace System.Windows.Markup #endif { internal enum StyleMode : byte { Base, // Style/Template tag, simple and top level complex properties TargetTypeProperty, // Target type complex property under a Style/Template BasedOnProperty, // BasedOn complex property under a Style/Template DataTypeProperty, // Data type complex property under a Template ComplexProperty, // Reading an allowed complex property under a Template Resources, // Resources complex property under a Style Setters, // Style.Setters IList complex property and subtree Key, // x:Key subtree when Style is used in a dictionary TriggerBase, // Style.TriggerBase complex property and subtree TriggerActions, // When in the middle of parsing EventTrigger.TriggerActions TriggerSetters, // When in the middle of parsing property trigger Setters collection TriggerEnterExitActions, // Trigger.EnterActions or Trigger.ExitActions VisualTree, // FrameworkTemplate.VisualTree's subtree } internal class StyleModeStack { internal StyleModeStack() { Push(StyleMode.Base); } internal int Depth { get { return _stack.Count - 1; } } internal StyleMode Mode { get { Debug.Assert(Depth >= 0, "StyleModeStack's depth was " + Depth + ", should be >= 0"); return _stack.Peek(); } } internal void Push (StyleMode mode) { _stack.Push(mode); } internal void Push () { Push(Mode); } internal StyleMode Pop() { Debug.Assert(Depth >= 0, "StyleMode::Pop() with depth of " + Depth + ", should be >= 0"); return _stack.Pop(); } private Stack _stack = new Stack (64); } } // 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
- ObsoleteAttribute.cs
- PageRequestManager.cs
- DataGridPageChangedEventArgs.cs
- ClientRuntimeConfig.cs
- CodeChecksumPragma.cs
- TdsValueSetter.cs
- StrongBox.cs
- EmptyStringExpandableObjectConverter.cs
- AnimationException.cs
- ZoneButton.cs
- TableChangeProcessor.cs
- SqlProvider.cs
- WebProxyScriptElement.cs
- NonceToken.cs
- SvcMapFileSerializer.cs
- XPathNodeList.cs
- AtomServiceDocumentSerializer.cs
- BaseConfigurationRecord.cs
- URI.cs
- SchemaMapping.cs
- SspiSafeHandles.cs
- OrCondition.cs
- MultiAsyncResult.cs
- EntityDataReader.cs
- SoapFault.cs
- ScriptingProfileServiceSection.cs
- DataGridViewCellStateChangedEventArgs.cs
- CodeExpressionCollection.cs
- DrawingAttributes.cs
- SoapObjectInfo.cs
- XPathNavigator.cs
- WebSysDefaultValueAttribute.cs
- BmpBitmapDecoder.cs
- WithStatement.cs
- StringDictionary.cs
- TextContainerChangedEventArgs.cs
- HtmlFormParameterReader.cs
- AdornerLayer.cs
- HuffmanTree.cs
- StorageEntitySetMapping.cs
- EventBindingService.cs
- WebPartDeleteVerb.cs
- PageVisual.cs
- TimelineCollection.cs
- LayoutEvent.cs
- HandlerBase.cs
- BufferedReceiveElement.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- InfoCardTraceRecord.cs
- CodeIdentifier.cs
- EntityViewContainer.cs
- PropertyDescriptorCollection.cs
- CompoundFileStorageReference.cs
- ToolStripLocationCancelEventArgs.cs
- ListSurrogate.cs
- SetterBase.cs
- CombinedGeometry.cs
- XmlSchemaExporter.cs
- HtmlInputImage.cs
- XPathAxisIterator.cs
- BinaryWriter.cs
- DebugView.cs
- AVElementHelper.cs
- OdbcReferenceCollection.cs
- ProcessHostFactoryHelper.cs
- RegionInfo.cs
- MultiTrigger.cs
- ImageButton.cs
- DataControlButton.cs
- CodeExpressionStatement.cs
- KeyboardNavigation.cs
- NavigationPropertyEmitter.cs
- MobileUITypeEditor.cs
- SqlDataSourceStatusEventArgs.cs
- _IPv6Address.cs
- TextShapeableCharacters.cs
- MultiBinding.cs
- IsolatedStorage.cs
- DesignSurfaceEvent.cs
- shaperfactoryquerycachekey.cs
- TypeExtension.cs
- ObjectTokenCategory.cs
- TransformValueSerializer.cs
- TextCollapsingProperties.cs
- XmlEventCache.cs
- AdRotator.cs
- Subtree.cs
- ListBindingHelper.cs
- HttpRuntimeSection.cs
- Storyboard.cs
- Attribute.cs
- OutputScope.cs
- CqlLexer.cs
- TableRowCollection.cs
- ValidatorCompatibilityHelper.cs
- PropertyStore.cs
- ListViewCommandEventArgs.cs
- SqlClientWrapperSmiStreamChars.cs
- Ray3DHitTestResult.cs
- DefaultParameterValueAttribute.cs