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
- OptimizerPatterns.cs
- ItemContainerGenerator.cs
- Comparer.cs
- UiaCoreApi.cs
- BitmapEffectCollection.cs
- XmlUtil.cs
- StreamAsIStream.cs
- QueryOperator.cs
- SoapFault.cs
- DispatcherProcessingDisabled.cs
- CacheRequest.cs
- StylusCollection.cs
- WebReferencesBuildProvider.cs
- SqlMethodAttribute.cs
- QilReference.cs
- ObjectSecurity.cs
- VirtualDirectoryMapping.cs
- KeyValueSerializer.cs
- WebControlAdapter.cs
- IISMapPath.cs
- SystemThemeKey.cs
- SqlServer2KCompatibilityAnnotation.cs
- AssemblyCache.cs
- ValidationHelper.cs
- VisualBrush.cs
- grammarelement.cs
- ListViewGroupItemCollection.cs
- StorageEntitySetMapping.cs
- SiteMapNodeItem.cs
- AssemblyCollection.cs
- KeyEventArgs.cs
- ToolStripStatusLabel.cs
- RoutedUICommand.cs
- ErrorsHelper.cs
- Cursor.cs
- ColorAnimationUsingKeyFrames.cs
- Setter.cs
- ToolStripOverflow.cs
- SmtpReplyReader.cs
- ColumnPropertiesGroup.cs
- hresults.cs
- HwndHostAutomationPeer.cs
- MD5.cs
- UpdateCommand.cs
- AxHost.cs
- SchemaImporterExtension.cs
- KeyPressEvent.cs
- _ConnectStream.cs
- RenderData.cs
- DataGridAddNewRow.cs
- WriterOutput.cs
- propertytag.cs
- EntityDataSourceViewSchema.cs
- OdbcHandle.cs
- GuidConverter.cs
- Util.cs
- CellRelation.cs
- ThaiBuddhistCalendar.cs
- FontConverter.cs
- WebPartConnectionsCloseVerb.cs
- TextBoxBaseDesigner.cs
- UriSchemeKeyedCollection.cs
- AudioBase.cs
- HttpHeaderCollection.cs
- InvalidOleVariantTypeException.cs
- InvalidDataException.cs
- ExtensibleSyndicationObject.cs
- ConfigurationStrings.cs
- Triplet.cs
- ConfigurationSchemaErrors.cs
- documentsequencetextview.cs
- ResourceAssociationTypeEnd.cs
- SecurityTokenSerializer.cs
- SubclassTypeValidator.cs
- ContextMarshalException.cs
- EntityFrameworkVersions.cs
- SkewTransform.cs
- PageSettings.cs
- PathFigureCollectionConverter.cs
- GridViewAutomationPeer.cs
- MouseGestureConverter.cs
- SQLMoneyStorage.cs
- ArraySubsetEnumerator.cs
- Membership.cs
- GraphicsPath.cs
- MouseEventArgs.cs
- HttpApplicationFactory.cs
- StylusButton.cs
- ToolStripGrip.cs
- FormsAuthenticationUser.cs
- DocumentOrderQuery.cs
- SmiConnection.cs
- EmbeddedMailObject.cs
- DbException.cs
- ResourceDictionary.cs
- COM2EnumConverter.cs
- SessionViewState.cs
- CallbackValidator.cs
- ListBoxItemAutomationPeer.cs
- DbCommandTree.cs