Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- Parameter.cs
- UInt32.cs
- AbandonedMutexException.cs
- StateMachineWorkflow.cs
- QilStrConcatenator.cs
- Point.cs
- DatePickerAutomationPeer.cs
- FormViewPageEventArgs.cs
- DefaultTextStoreTextComposition.cs
- CompiledQueryCacheEntry.cs
- BrowserDefinitionCollection.cs
- XsdBuilder.cs
- AccessViolationException.cs
- EdmValidator.cs
- BindingList.cs
- SessionIDManager.cs
- OpacityConverter.cs
- KoreanLunisolarCalendar.cs
- ColorInterpolationModeValidation.cs
- TrackingServices.cs
- MouseEventArgs.cs
- GetParentChain.cs
- UIElement.cs
- HtmlTableRowCollection.cs
- GenericParameterDataContract.cs
- NumberFunctions.cs
- NotImplementedException.cs
- InkPresenterAutomationPeer.cs
- Pair.cs
- ImportCatalogPart.cs
- SystemInfo.cs
- Light.cs
- XsdValidatingReader.cs
- RegisterInfo.cs
- RowUpdatingEventArgs.cs
- CharEnumerator.cs
- CuspData.cs
- Mappings.cs
- FamilyTypeface.cs
- ModelTreeEnumerator.cs
- Attributes.cs
- CodeObjectCreateExpression.cs
- CacheEntry.cs
- StringExpressionSet.cs
- LinqMaximalSubtreeNominator.cs
- BindingOperations.cs
- AnyAllSearchOperator.cs
- StyleBamlRecordReader.cs
- XmlQualifiedName.cs
- ToolboxBitmapAttribute.cs
- ContractType.cs
- WorkflowApplicationAbortedEventArgs.cs
- GenericEnumerator.cs
- Line.cs
- securitymgrsite.cs
- DesignerUtils.cs
- ObjectDataSourceChooseMethodsPanel.cs
- DocumentCollection.cs
- PersonalizationStateQuery.cs
- TimeManager.cs
- SchemaImporterExtensionElementCollection.cs
- PageHandlerFactory.cs
- XmlNamedNodeMap.cs
- Crypto.cs
- SyndicationFeedFormatter.cs
- DeadCharTextComposition.cs
- RecognizedAudio.cs
- FlowDecision.cs
- SplineKeyFrames.cs
- WebPartZoneBase.cs
- DeferredTextReference.cs
- WebPartManagerInternals.cs
- DocumentApplication.cs
- PeerSecurityManager.cs
- WorkflowRuntimeServiceElementCollection.cs
- Matrix.cs
- QuaternionAnimation.cs
- SqlNode.cs
- IriParsingElement.cs
- XmlQuerySequence.cs
- XPathDocumentBuilder.cs
- ConfigXmlWhitespace.cs
- Visitors.cs
- Focus.cs
- ExpressionEvaluator.cs
- ProjectionCamera.cs
- StateMachineWorkflow.cs
- smtppermission.cs
- SafeMILHandle.cs
- CompareValidator.cs
- PersistenceTypeAttribute.cs
- WebPartConnectionsCancelVerb.cs
- FormsIdentity.cs
- Inflater.cs
- ReferenceService.cs
- ToolboxItemCollection.cs
- metadatamappinghashervisitor.cs
- FixedSOMContainer.cs
- TripleDES.cs
- MergeFilterQuery.cs