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
- BitStream.cs
- NegationPusher.cs
- EditBehavior.cs
- SQLCharsStorage.cs
- DataGridViewHeaderCell.cs
- EntityDataSourceViewSchema.cs
- ExpressionBuilderCollection.cs
- DockPatternIdentifiers.cs
- EdmSchemaError.cs
- Events.cs
- ContainerSelectorGlyph.cs
- HeaderedItemsControl.cs
- ExpressionNormalizer.cs
- ChildTable.cs
- Logging.cs
- _ConnectStream.cs
- PageThemeParser.cs
- DataServiceSaveChangesEventArgs.cs
- PointValueSerializer.cs
- Bidi.cs
- SqlFacetAttribute.cs
- CollectionViewGroup.cs
- CodeValidator.cs
- TextPointerBase.cs
- webeventbuffer.cs
- StateElementCollection.cs
- ByteAnimationBase.cs
- _BasicClient.cs
- JpegBitmapDecoder.cs
- Debug.cs
- Environment.cs
- SessionStateModule.cs
- ObjectDataSourceSelectingEventArgs.cs
- ItemAutomationPeer.cs
- VisualCollection.cs
- XmlDataSource.cs
- SqlUDTStorage.cs
- EntityWithChangeTrackerStrategy.cs
- DataGridTextBoxColumn.cs
- WebPartActionVerb.cs
- ZipIOModeEnforcingStream.cs
- URLString.cs
- TextBox.cs
- PropertyGrid.cs
- DataSpaceManager.cs
- SelectionPatternIdentifiers.cs
- NavigationWindow.cs
- IDispatchConstantAttribute.cs
- CellCreator.cs
- AnnotationResource.cs
- StateDesigner.cs
- CryptographicAttribute.cs
- SafeCryptoHandles.cs
- AttributeCollection.cs
- SHA384Managed.cs
- ELinqQueryState.cs
- CustomAttributeBuilder.cs
- MimeXmlReflector.cs
- SqlDataSourceWizardForm.cs
- ActionItem.cs
- WindowInteractionStateTracker.cs
- CheckBoxFlatAdapter.cs
- TripleDES.cs
- HttpPostProtocolReflector.cs
- RankException.cs
- DataGridViewImageCell.cs
- TextEditorParagraphs.cs
- EncoderParameters.cs
- OledbConnectionStringbuilder.cs
- DescendantBaseQuery.cs
- ApplicationFileCodeDomTreeGenerator.cs
- filewebrequest.cs
- SafeFindHandle.cs
- DataSourceComponent.cs
- KeyFrames.cs
- RestHandlerFactory.cs
- ResXDataNode.cs
- PrintPreviewDialog.cs
- PointAnimationUsingKeyFrames.cs
- HwndKeyboardInputProvider.cs
- EntityDataSourceStatementEditorForm.cs
- JapaneseLunisolarCalendar.cs
- FlowDocumentReader.cs
- ThemeableAttribute.cs
- webclient.cs
- SessionStateContainer.cs
- DataGridTableCollection.cs
- Activity.cs
- EntityContainerRelationshipSetEnd.cs
- FileDialog_Vista_Interop.cs
- EventPrivateKey.cs
- HttpCacheParams.cs
- HealthMonitoringSectionHelper.cs
- BasicExpressionVisitor.cs
- Button.cs
- FlowLayoutSettings.cs
- DataGridTemplateColumn.cs
- ExtendedPropertyDescriptor.cs
- TextTrailingCharacterEllipsis.cs
- TextTreeUndoUnit.cs