Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / StyleModeStack.cs / 1305600 / 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
- XamlPoint3DCollectionSerializer.cs
- RelatedImageListAttribute.cs
- StateFinalizationActivity.cs
- UInt64Converter.cs
- ProtocolReflector.cs
- HttpModuleActionCollection.cs
- _CookieModule.cs
- DeferredSelectedIndexReference.cs
- SecurityAccessDeniedException.cs
- DataControlFieldCollection.cs
- ToolStripDropDown.cs
- OpacityConverter.cs
- TracingConnectionListener.cs
- Misc.cs
- LinearKeyFrames.cs
- BaseTypeViewSchema.cs
- OleDbPropertySetGuid.cs
- InvokeGenerator.cs
- Component.cs
- JobInputBins.cs
- SecurityContext.cs
- HttpContext.cs
- _ConnectionGroup.cs
- NotFiniteNumberException.cs
- InvokeProviderWrapper.cs
- Rotation3D.cs
- DragAssistanceManager.cs
- HwndProxyElementProvider.cs
- WebConfigurationFileMap.cs
- DataServiceEntityAttribute.cs
- Constraint.cs
- ResourceIDHelper.cs
- SafeEventHandle.cs
- TreeNodeEventArgs.cs
- QilTypeChecker.cs
- GridErrorDlg.cs
- InkCanvas.cs
- GatewayIPAddressInformationCollection.cs
- HyperLink.cs
- Misc.cs
- ListViewItemMouseHoverEvent.cs
- XmlTextWriter.cs
- AuthenticationManager.cs
- DocumentDesigner.cs
- XmlAggregates.cs
- ImageAttributes.cs
- DataServiceContext.cs
- HtmlUtf8RawTextWriter.cs
- PropertyManager.cs
- DataGrid.cs
- ProfileInfo.cs
- UInt64Storage.cs
- XamlPointCollectionSerializer.cs
- xmlsaver.cs
- GridViewRowPresenter.cs
- Exceptions.cs
- ListBoxItemAutomationPeer.cs
- DesignTimeTemplateParser.cs
- CaseInsensitiveComparer.cs
- HeaderUtility.cs
- DataBindingExpressionBuilder.cs
- SelectingProviderEventArgs.cs
- DefaultBinder.cs
- Shape.cs
- ApplicationFileCodeDomTreeGenerator.cs
- HeaderCollection.cs
- OperationInfoBase.cs
- ExpressionParser.cs
- OutputCacheModule.cs
- XmlEntityReference.cs
- DictionaryEntry.cs
- TableLayoutSettings.cs
- WebBaseEventKeyComparer.cs
- GridViewActionList.cs
- MergablePropertyAttribute.cs
- SqlNotificationRequest.cs
- TimeSpanOrInfiniteConverter.cs
- NamedPermissionSet.cs
- HttpConfigurationContext.cs
- ConfigXmlWhitespace.cs
- SecuritySessionClientSettings.cs
- GcSettings.cs
- FormattedText.cs
- nulltextcontainer.cs
- IconBitmapDecoder.cs
- StatusBarDrawItemEvent.cs
- SiteMapDataSource.cs
- GradientStop.cs
- RuntimeConfigurationRecord.cs
- DbExpressionVisitor_TResultType.cs
- EmptyQuery.cs
- TextDecorationLocationValidation.cs
- FileBasedResourceGroveler.cs
- XPathBuilder.cs
- _HeaderInfoTable.cs
- EmptyWithCancelationCheckWorkItem.cs
- Rights.cs
- BindingValueChangedEventArgs.cs
- XmlResolver.cs
- DependencySource.cs