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
- BinaryParser.cs
- TraceHelpers.cs
- TcpStreams.cs
- ServiceHostFactory.cs
- PageClientProxyGenerator.cs
- ConversionValidationRule.cs
- ClientConfigurationSystem.cs
- elementinformation.cs
- TransformPattern.cs
- ThreadPool.cs
- UInt32Storage.cs
- RijndaelManaged.cs
- JavaScriptSerializer.cs
- ImagingCache.cs
- DataSpaceManager.cs
- ProjectionNode.cs
- TextTreeTextBlock.cs
- ResourceExpression.cs
- VoiceInfo.cs
- Win32Exception.cs
- AttributeParameterInfo.cs
- HashSetEqualityComparer.cs
- AssemblyBuilder.cs
- DataObjectFieldAttribute.cs
- XPathConvert.cs
- StreamAsIStream.cs
- ToolBarButtonDesigner.cs
- BuildProvider.cs
- ReliableSessionBindingElement.cs
- DeflateStream.cs
- OrderPreservingPipeliningSpoolingTask.cs
- Rights.cs
- XmlResolver.cs
- FormViewUpdatedEventArgs.cs
- IgnoreDeviceFilterElementCollection.cs
- TrackingConditionCollection.cs
- Assert.cs
- EventlogProvider.cs
- CheckBoxPopupAdapter.cs
- IssuedTokenParametersEndpointAddressElement.cs
- MobileListItem.cs
- WebRequestModulesSection.cs
- UInt64Storage.cs
- EncodingDataItem.cs
- TabControlCancelEvent.cs
- ISCIIEncoding.cs
- WorkerRequest.cs
- DockPattern.cs
- StatusStrip.cs
- ResourceContainerWrapper.cs
- BroadcastEventHelper.cs
- StylusPointPropertyId.cs
- TokenFactoryBase.cs
- UrlMappingCollection.cs
- CodeArrayCreateExpression.cs
- AuthenticationSection.cs
- DataFormats.cs
- Assembly.cs
- RSAPKCS1SignatureFormatter.cs
- JsonWriter.cs
- ColorConverter.cs
- ScalarType.cs
- Aes.cs
- SymbolType.cs
- TrackingStringDictionary.cs
- WarningException.cs
- SecurityTokenException.cs
- ApplicationSecurityInfo.cs
- PersistChildrenAttribute.cs
- SystemInfo.cs
- PropertyTab.cs
- EmptyReadOnlyDictionaryInternal.cs
- Encoding.cs
- TemplateAction.cs
- _NTAuthentication.cs
- HttpRawResponse.cs
- GridView.cs
- LineBreak.cs
- Inline.cs
- IncrementalReadDecoders.cs
- DynamicRenderer.cs
- iisPickupDirectory.cs
- CodeAssignStatement.cs
- Viewport3DVisual.cs
- ValuePattern.cs
- UnsafeNetInfoNativeMethods.cs
- FormViewRow.cs
- Label.cs
- ExclusiveCanonicalizationTransform.cs
- UIElement3DAutomationPeer.cs
- SystemPens.cs
- FileUtil.cs
- graph.cs
- SimpleHandlerBuildProvider.cs
- SafeFileMappingHandle.cs
- ActivityTypeCodeDomSerializer.cs
- Vector3DConverter.cs
- Crc32.cs
- KeyConverter.cs
- SmiRequestExecutor.cs