Code:
/ 4.0 / 4.0 / 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. 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
- GetCryptoTransformRequest.cs
- CacheMode.cs
- ImageAutomationPeer.cs
- validation.cs
- ByteAnimationBase.cs
- PartialList.cs
- XmlObjectSerializerContext.cs
- DoubleIndependentAnimationStorage.cs
- SourceSwitch.cs
- Int32Animation.cs
- BitmapMetadataEnumerator.cs
- RbTree.cs
- Point3DCollection.cs
- UrlAuthorizationModule.cs
- Brush.cs
- odbcmetadatafactory.cs
- SolidBrush.cs
- path.cs
- XmlCodeExporter.cs
- Attributes.cs
- ImageSourceTypeConverter.cs
- TextBoxBase.cs
- ParseHttpDate.cs
- ComponentDispatcher.cs
- XmlSchemaIdentityConstraint.cs
- ICspAsymmetricAlgorithm.cs
- PrimitiveXmlSerializers.cs
- TypeSystem.cs
- CodeTypeDeclarationCollection.cs
- ReadOnlyCollection.cs
- ReflectionHelper.cs
- sortedlist.cs
- ConnectionPointCookie.cs
- CalendarButton.cs
- PenThreadPool.cs
- ViewValidator.cs
- Policy.cs
- Panel.cs
- CompilerError.cs
- Metadata.cs
- Application.cs
- SchemaDeclBase.cs
- StringAnimationBase.cs
- ClientCultureInfo.cs
- ActivityDesignerLayoutSerializers.cs
- EventSourceCreationData.cs
- SqlDependency.cs
- AffineTransform3D.cs
- DataGridViewRowsAddedEventArgs.cs
- TextParaLineResult.cs
- ModelProperty.cs
- SchemaNames.cs
- FontStyles.cs
- IResourceProvider.cs
- PointLightBase.cs
- sqlpipe.cs
- MsmqInputChannel.cs
- SimpleTypeResolver.cs
- _ChunkParse.cs
- DataTableClearEvent.cs
- TemplatePagerField.cs
- SerializationEventsCache.cs
- SqlStream.cs
- IgnoreFlushAndCloseStream.cs
- EncryptedXml.cs
- LinqDataSourceHelper.cs
- BaseContextMenu.cs
- Geometry.cs
- DataGridState.cs
- TypeLibConverter.cs
- CodeGenerator.cs
- StructuredTypeEmitter.cs
- XpsImage.cs
- ExpressionTextBox.xaml.cs
- EdmError.cs
- IDispatchConstantAttribute.cs
- TaskFactory.cs
- DeclarativeCatalogPart.cs
- UriScheme.cs
- CommunicationObjectManager.cs
- ToolStripMenuItem.cs
- DataBoundControlAdapter.cs
- XmlNamedNodeMap.cs
- Path.cs
- PrivacyNoticeElement.cs
- MsmqIntegrationOutputChannel.cs
- ListControl.cs
- DocumentViewerBaseAutomationPeer.cs
- COAUTHINFO.cs
- XpsFont.cs
- FloatMinMaxAggregationOperator.cs
- DataSourceSelectArguments.cs
- LineGeometry.cs
- Pair.cs
- UInt64Converter.cs
- DbSourceParameterCollection.cs
- RectangleGeometry.cs
- ChannelFactoryRefCache.cs
- TemplateInstanceAttribute.cs
- LayoutEditorPart.cs