Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- TextViewDesigner.cs
- LoadWorkflowAsyncResult.cs
- PerfCounterSection.cs
- TrackingStringDictionary.cs
- FixedSOMFixedBlock.cs
- ValueConversionAttribute.cs
- OpenFileDialog.cs
- TextServicesCompartment.cs
- SetIndexBinder.cs
- DecimalAnimationBase.cs
- SafeNativeMemoryHandle.cs
- InheritanceContextChangedEventManager.cs
- MultiBindingExpression.cs
- XPathNavigatorException.cs
- AsyncCompletedEventArgs.cs
- StorageMappingItemLoader.cs
- FileVersionInfo.cs
- StringWriter.cs
- StrongNameUtility.cs
- TextRunTypographyProperties.cs
- Soap.cs
- Border.cs
- Baml6ConstructorInfo.cs
- DirectoryNotFoundException.cs
- OutputCacheSettings.cs
- PermissionSetTriple.cs
- SoapSchemaExporter.cs
- TimerExtension.cs
- DocumentPaginator.cs
- StdValidatorsAndConverters.cs
- XAMLParseException.cs
- Quad.cs
- PackageProperties.cs
- DropDownButton.cs
- EventSinkHelperWriter.cs
- CompilerState.cs
- sapiproxy.cs
- StringValueSerializer.cs
- PointAnimationBase.cs
- ObjectStateManagerMetadata.cs
- ReliableOutputSessionChannel.cs
- SqlMultiplexer.cs
- TextContainerChangeEventArgs.cs
- XmlDataLoader.cs
- StringValidatorAttribute.cs
- DynamicExpression.cs
- COAUTHINFO.cs
- ObjectNotFoundException.cs
- RegistryConfigurationProvider.cs
- Wildcard.cs
- ColumnClickEvent.cs
- MediaContext.cs
- AttributeEmitter.cs
- WinEventWrap.cs
- SqlGatherConsumedAliases.cs
- MenuItemBinding.cs
- OutputCacheSettings.cs
- WindowsGraphics.cs
- DrawListViewItemEventArgs.cs
- HandledMouseEvent.cs
- NumberEdit.cs
- RouteCollection.cs
- HashStream.cs
- BindingEditor.xaml.cs
- XmlSignificantWhitespace.cs
- mediaeventargs.cs
- XPathBinder.cs
- ContactManager.cs
- oledbmetadatacollectionnames.cs
- QuadraticBezierSegment.cs
- Application.cs
- UnsupportedPolicyOptionsException.cs
- RecordManager.cs
- AssemblyCache.cs
- TypeTypeConverter.cs
- TreeIterators.cs
- NetworkInterface.cs
- EventLogPermissionEntry.cs
- mansign.cs
- IndexedEnumerable.cs
- StringStorage.cs
- SoapIncludeAttribute.cs
- GeometryDrawing.cs
- EventRouteFactory.cs
- OdbcRowUpdatingEvent.cs
- ConcurrencyMode.cs
- RequestQueue.cs
- Utils.cs
- InProcStateClientManager.cs
- VariableQuery.cs
- NamedPermissionSet.cs
- AutoSizeToolBoxItem.cs
- Floater.cs
- WindowsSecurityTokenAuthenticator.cs
- UnsafeNativeMethodsCLR.cs
- AutomationEventArgs.cs
- ReflectionServiceProvider.cs
- WebPartEditorApplyVerb.cs
- MdiWindowListItemConverter.cs
- X509ChainElement.cs