Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / StyleModeStack.cs / 1305600 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WhiteSpaceTrimStringConverter.cs
- DescendantOverDescendantQuery.cs
- WebPartZoneBase.cs
- CompilerErrorCollection.cs
- GetMemberBinder.cs
- RegisteredArrayDeclaration.cs
- OdbcConnectionFactory.cs
- DataViewSettingCollection.cs
- Stylus.cs
- EndpointAddress10.cs
- DefaultPropertyAttribute.cs
- MemberDomainMap.cs
- UrlAuthFailedErrorFormatter.cs
- XmlSchemaAny.cs
- TagMapInfo.cs
- ChannelTracker.cs
- SimpleRecyclingCache.cs
- TreeViewHitTestInfo.cs
- Graphics.cs
- GridViewCommandEventArgs.cs
- MdImport.cs
- HtmlValidatorAdapter.cs
- log.cs
- DataGridViewComboBoxCell.cs
- BamlLocalizableResource.cs
- TextProperties.cs
- PermissionListSet.cs
- XmlSchemaIdentityConstraint.cs
- XmlSchemas.cs
- Command.cs
- _HeaderInfoTable.cs
- ColorConvertedBitmapExtension.cs
- StructuralCache.cs
- XmlWrappingWriter.cs
- MethodBuilderInstantiation.cs
- BinaryFormatterSinks.cs
- RoutedEvent.cs
- Privilege.cs
- RangeValidator.cs
- SimpleExpression.cs
- WindowsRebar.cs
- OracleRowUpdatedEventArgs.cs
- Parser.cs
- SqlRowUpdatingEvent.cs
- storepermissionattribute.cs
- SharedPerformanceCounter.cs
- FontStretchConverter.cs
- DesignerToolStripControlHost.cs
- BitmapImage.cs
- HtmlWindow.cs
- DataColumnMapping.cs
- EnumBuilder.cs
- DateTimePicker.cs
- EventPropertyMap.cs
- StructuredProperty.cs
- DbgUtil.cs
- coordinatorfactory.cs
- CustomAttribute.cs
- SortKey.cs
- XmlDeclaration.cs
- AppDomain.cs
- Clipboard.cs
- StatusBarAutomationPeer.cs
- CompilerError.cs
- ObjRef.cs
- SudsWriter.cs
- MultipartContentParser.cs
- PostBackTrigger.cs
- FormatSettings.cs
- ProcessThread.cs
- TransformProviderWrapper.cs
- Wizard.cs
- XmlAnyElementAttributes.cs
- WindowsTitleBar.cs
- EntitySqlQueryState.cs
- XmlSchemaSimpleTypeUnion.cs
- ItemChangedEventArgs.cs
- SignatureToken.cs
- TextViewSelectionProcessor.cs
- TdsParser.cs
- SecurityManager.cs
- DesignerHost.cs
- CodeDOMUtility.cs
- LambdaExpression.cs
- EntitySetDataBindingList.cs
- EntityViewGenerationAttribute.cs
- DispatcherExceptionFilterEventArgs.cs
- OutputWindow.cs
- CacheManager.cs
- DateTimeStorage.cs
- WebBrowser.cs
- ObjectContextServiceProvider.cs
- TransformerConfigurationWizardBase.cs
- OdbcConnection.cs
- XmlSchemaException.cs
- WebBrowserUriTypeConverter.cs
- IODescriptionAttribute.cs
- EntityFrameworkVersions.cs
- SecurityStateEncoder.cs
- CompensatableTransactionScopeActivity.cs