Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- SoapEnumAttribute.cs
- SiteMapNodeCollection.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- DirectoryNotFoundException.cs
- X509Extension.cs
- DesignerInterfaces.cs
- EditingMode.cs
- EntityViewContainer.cs
- DataBoundControlAdapter.cs
- QilInvoke.cs
- Point3DCollection.cs
- DynamicMethod.cs
- UserPreferenceChangedEventArgs.cs
- Table.cs
- MouseButtonEventArgs.cs
- DataRowComparer.cs
- AccessDataSource.cs
- PartialCachingAttribute.cs
- OperandQuery.cs
- HttpProtocolImporter.cs
- MgmtConfigurationRecord.cs
- CodeArrayCreateExpression.cs
- DictionaryCustomTypeDescriptor.cs
- SrgsGrammar.cs
- BlurBitmapEffect.cs
- SvcMapFileLoader.cs
- _AutoWebProxyScriptHelper.cs
- TextView.cs
- DataException.cs
- CustomAttributeSerializer.cs
- basecomparevalidator.cs
- Int32CollectionValueSerializer.cs
- ServiceHandle.cs
- AutomationPatternInfo.cs
- Utils.cs
- EntityParameterCollection.cs
- ManagedWndProcTracker.cs
- FlowLayoutPanelDesigner.cs
- WebFaultClientMessageInspector.cs
- ItemList.cs
- SkinBuilder.cs
- WebEventTraceProvider.cs
- LinkAreaEditor.cs
- QuaternionValueSerializer.cs
- AddInContractAttribute.cs
- PingOptions.cs
- RegexMatchCollection.cs
- Msec.cs
- JulianCalendar.cs
- ExtensionQuery.cs
- DynamicActivityTypeDescriptor.cs
- SystemWebSectionGroup.cs
- HttpListenerResponse.cs
- PropertyDescriptorGridEntry.cs
- FunctionImportElement.cs
- MediaPlayerState.cs
- MergePropertyDescriptor.cs
- _FixedSizeReader.cs
- Zone.cs
- DeclarationUpdate.cs
- EntityDataSourceColumn.cs
- LookupNode.cs
- DictionaryGlobals.cs
- AutomationTextAttribute.cs
- TrustLevelCollection.cs
- TableLayoutCellPaintEventArgs.cs
- ProcessModelSection.cs
- ArraySortHelper.cs
- AudioBase.cs
- XmlSerializerOperationFormatter.cs
- DataError.cs
- FormsAuthenticationEventArgs.cs
- ExpressionBinding.cs
- SpeakProgressEventArgs.cs
- Context.cs
- InitializeCorrelation.cs
- ProjectionPathBuilder.cs
- BitmapCodecInfo.cs
- ArraySortHelper.cs
- PersonalizationEntry.cs
- DataKey.cs
- PrimitiveXmlSerializers.cs
- CacheModeConverter.cs
- TouchPoint.cs
- IISMapPath.cs
- GetLastErrorDetailsRequest.cs
- UIPermission.cs
- ItemChangedEventArgs.cs
- DesignOnlyAttribute.cs
- PropertyGridEditorPart.cs
- XamlSerializerUtil.cs
- EventLogPermission.cs
- DrawingCollection.cs
- BamlMapTable.cs
- HostingEnvironment.cs
- StrokeCollectionDefaultValueFactory.cs
- Axis.cs
- SqlDuplicator.cs
- MDIClient.cs
- EventBuilder.cs