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
- DataSetMappper.cs
- SafeFileMappingHandle.cs
- AbandonedMutexException.cs
- DataGridViewCellEventArgs.cs
- DateTimePicker.cs
- PanelStyle.cs
- Message.cs
- TransformCollection.cs
- RsaSecurityTokenAuthenticator.cs
- MessageVersionConverter.cs
- UnsafeNativeMethods.cs
- TraceUtility.cs
- MetaModel.cs
- SafeThemeHandle.cs
- AutomationElementCollection.cs
- GlobalizationSection.cs
- Misc.cs
- SymLanguageType.cs
- ConfigXmlSignificantWhitespace.cs
- EncodingTable.cs
- BinaryOperationBinder.cs
- FieldBuilder.cs
- IisTraceListener.cs
- DataContractSerializerSection.cs
- DataGridViewRowsRemovedEventArgs.cs
- StringResourceManager.cs
- StylusSystemGestureEventArgs.cs
- SplitterCancelEvent.cs
- ConfigurationException.cs
- ClientScriptManagerWrapper.cs
- CodeLinePragma.cs
- WebRequest.cs
- ArrayWithOffset.cs
- GenericIdentity.cs
- Button.cs
- InfiniteTimeSpanConverter.cs
- SchemaNamespaceManager.cs
- TypeToArgumentTypeConverter.cs
- AnyAllSearchOperator.cs
- EventSourceCreationData.cs
- MultiDataTrigger.cs
- PrePrepareMethodAttribute.cs
- __Filters.cs
- ListViewContainer.cs
- GridView.cs
- ControlType.cs
- SecurityTokenTypes.cs
- OleTxTransactionInfo.cs
- MetricEntry.cs
- CurrentChangingEventManager.cs
- AnnotationMap.cs
- DataException.cs
- ContainsRowNumberChecker.cs
- AxHost.cs
- DelimitedListTraceListener.cs
- CharEnumerator.cs
- Emitter.cs
- DataGridViewSelectedRowCollection.cs
- WebPartEditVerb.cs
- NavigatorOutput.cs
- StylusTouchDevice.cs
- EditorZone.cs
- MaterialGroup.cs
- HandledEventArgs.cs
- Gdiplus.cs
- ChangeBlockUndoRecord.cs
- RangeValueProviderWrapper.cs
- SecureEnvironment.cs
- assertwrapper.cs
- ResourceReferenceExpression.cs
- OleDbTransaction.cs
- MarkupCompilePass2.cs
- RoutedEventConverter.cs
- EntityWrapperFactory.cs
- XsdBuildProvider.cs
- DynamicFilterExpression.cs
- WindowsAuthenticationModule.cs
- InfoCardSchemas.cs
- TrackingStringDictionary.cs
- ipaddressinformationcollection.cs
- MailMessage.cs
- XmlReflectionImporter.cs
- TableItemPattern.cs
- DoubleStorage.cs
- xdrvalidator.cs
- ReadOnlyPropertyMetadata.cs
- RuleSettingsCollection.cs
- CompilerWrapper.cs
- HttpInputStream.cs
- RequestQueue.cs
- TextRangeEditLists.cs
- SchemaEntity.cs
- TypeConverterHelper.cs
- DataGridViewTopLeftHeaderCell.cs
- ConfigurationProperty.cs
- HitTestDrawingContextWalker.cs
- DockPattern.cs
- WindowsPrincipal.cs
- BooleanSwitch.cs
- QuaternionAnimation.cs