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
- VisualStyleRenderer.cs
- InstanceDataCollection.cs
- AssemblySettingAttributes.cs
- DocumentCollection.cs
- DrawListViewItemEventArgs.cs
- TextFormatterContext.cs
- SeparatorAutomationPeer.cs
- CodeDOMProvider.cs
- oledbmetadatacolumnnames.cs
- DiscoveryDocumentSearchPattern.cs
- String.cs
- UInt32.cs
- FileRecordSequence.cs
- ListenerBinder.cs
- HatchBrush.cs
- KeyProperty.cs
- TimeSpanStorage.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- DataSourceControl.cs
- UnmanagedHandle.cs
- Hex.cs
- TargetConverter.cs
- SchemaImporterExtensionElementCollection.cs
- SoapParser.cs
- ApplicationBuildProvider.cs
- VariableQuery.cs
- KeyMatchBuilder.cs
- XmlIgnoreAttribute.cs
- WebResponse.cs
- FileUpload.cs
- localization.cs
- GetChildSubtree.cs
- RowsCopiedEventArgs.cs
- LinqExpressionNormalizer.cs
- BitmapEffectGroup.cs
- ClockGroup.cs
- PrimaryKeyTypeConverter.cs
- StatementContext.cs
- AdornerHitTestResult.cs
- TextEditorSelection.cs
- EncoderFallback.cs
- MessageSmuggler.cs
- ApplicationDirectoryMembershipCondition.cs
- SharedStatics.cs
- WindowsBrush.cs
- METAHEADER.cs
- Emitter.cs
- XmlSerializationReader.cs
- ComplexTypeEmitter.cs
- ModelItemExtensions.cs
- CodeBlockBuilder.cs
- QilDataSource.cs
- BitmapFrame.cs
- PrivilegeNotHeldException.cs
- ContentControl.cs
- TaiwanLunisolarCalendar.cs
- SQLMoneyStorage.cs
- FocusTracker.cs
- NetworkStream.cs
- Polyline.cs
- WebPartMenu.cs
- RuntimeVariablesExpression.cs
- Section.cs
- StreamInfo.cs
- RuleRef.cs
- XsdDateTime.cs
- SmiEventStream.cs
- NavigationEventArgs.cs
- AppSecurityManager.cs
- IISMapPath.cs
- RowToFieldTransformer.cs
- XmlToDatasetMap.cs
- OracleDataReader.cs
- SerializationAttributes.cs
- InkCanvasAutomationPeer.cs
- MarkupExtensionReturnTypeAttribute.cs
- GiveFeedbackEvent.cs
- CFStream.cs
- RequestCacheEntry.cs
- DocumentGridContextMenu.cs
- EntityType.cs
- WebBrowserNavigatedEventHandler.cs
- HotCommands.cs
- CopyOnWriteList.cs
- ScalarRestriction.cs
- HelloOperationAsyncResult.cs
- Binding.cs
- ProxyHelper.cs
- _HelperAsyncResults.cs
- ObjectSpanRewriter.cs
- ScriptBehaviorDescriptor.cs
- Tokenizer.cs
- WebServicesInteroperability.cs
- KeyEvent.cs
- PropertyGridEditorPart.cs
- TrackBarRenderer.cs
- ConstructorExpr.cs
- EntryPointNotFoundException.cs
- HwndHost.cs