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
- Membership.cs
- ContextDataSource.cs
- EnvironmentPermission.cs
- EntitySet.cs
- FullTextState.cs
- InstanceOwnerQueryResult.cs
- OpenFileDialog.cs
- BindingCollection.cs
- WindowsToolbarAsMenu.cs
- MsmqIntegrationInputMessage.cs
- ColorContextHelper.cs
- ResumeStoryboard.cs
- sqlpipe.cs
- basenumberconverter.cs
- SimpleTextLine.cs
- XmlSchemaAnnotation.cs
- CompoundFileStreamReference.cs
- NotFiniteNumberException.cs
- CollectionBuilder.cs
- MatchingStyle.cs
- WebConfigurationHostFileChange.cs
- EventMappingSettingsCollection.cs
- RenderCapability.cs
- HMACSHA512.cs
- TextBox.cs
- IdnMapping.cs
- PrivacyNoticeBindingElement.cs
- CodeCatchClause.cs
- PathGradientBrush.cs
- RefreshEventArgs.cs
- HtmlGenericControl.cs
- InputScopeManager.cs
- PageSetupDialog.cs
- SHA256CryptoServiceProvider.cs
- OracleMonthSpan.cs
- ObjectContext.cs
- Constant.cs
- ObjectSecurity.cs
- future.cs
- StateDesigner.TransitionInfo.cs
- Stream.cs
- ReleaseInstanceMode.cs
- IdentityValidationException.cs
- LinkGrep.cs
- Int32CAMarshaler.cs
- Translator.cs
- ITextView.cs
- BrowserCapabilitiesCodeGenerator.cs
- ObjectSpanRewriter.cs
- AttributeProviderAttribute.cs
- VirtualizedContainerService.cs
- DSACryptoServiceProvider.cs
- mediaeventargs.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- XmlValidatingReader.cs
- Process.cs
- XmlIncludeAttribute.cs
- TextInfo.cs
- _ContextAwareResult.cs
- DbConnectionHelper.cs
- QueryUtil.cs
- XmlDataSourceView.cs
- StreamAsIStream.cs
- XmlArrayItemAttribute.cs
- SerializationEventsCache.cs
- DataBindingExpressionBuilder.cs
- SmiMetaDataProperty.cs
- WebColorConverter.cs
- MarkedHighlightComponent.cs
- panel.cs
- sqlpipe.cs
- ResourceIDHelper.cs
- ActiveDesignSurfaceEvent.cs
- ContainsRowNumberChecker.cs
- ListControlBuilder.cs
- DocumentDesigner.cs
- ClonableStack.cs
- DriveNotFoundException.cs
- ThreadExceptionDialog.cs
- SerializationFieldInfo.cs
- WindowsListViewScroll.cs
- EdmValidator.cs
- BaseCodePageEncoding.cs
- DataGridLength.cs
- Annotation.cs
- RemotingException.cs
- TimeStampChecker.cs
- StreamingContext.cs
- Rotation3DAnimation.cs
- Cloud.cs
- Speller.cs
- DataGridToolTip.cs
- COM2PictureConverter.cs
- brushes.cs
- DataContractSerializerServiceBehavior.cs
- SimpleTextLine.cs
- BindingExpressionBase.cs
- CryptoHelper.cs
- UnionExpr.cs
- UseAttributeSetsAction.cs