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
- ScaleTransform3D.cs
- EditCommandColumn.cs
- AutomationElementCollection.cs
- ZipPackage.cs
- DataServiceClientException.cs
- XPathMultyIterator.cs
- ValidatorUtils.cs
- CodeAttachEventStatement.cs
- ObjectPersistData.cs
- TrackingAnnotationCollection.cs
- MethodCallExpression.cs
- Light.cs
- Module.cs
- OperatingSystem.cs
- InfoCardClaimCollection.cs
- MessageCredentialType.cs
- SortableBindingList.cs
- ConfigXmlWhitespace.cs
- Zone.cs
- RTLAwareMessageBox.cs
- COM2FontConverter.cs
- AssociationEndMember.cs
- MainMenu.cs
- HtmlAnchor.cs
- BigInt.cs
- StringExpressionSet.cs
- PreviewKeyDownEventArgs.cs
- ObjectViewEntityCollectionData.cs
- ToolboxItemWrapper.cs
- HitTestWithPointDrawingContextWalker.cs
- ComponentCollection.cs
- CryptoProvider.cs
- CheckedPointers.cs
- ProjectionCamera.cs
- CustomActivityDesigner.cs
- TabletDeviceInfo.cs
- WebPartTransformer.cs
- WorkflowQueuingService.cs
- DBDataPermission.cs
- ItemsChangedEventArgs.cs
- thaishape.cs
- Timer.cs
- DependencyPropertyConverter.cs
- EncoderNLS.cs
- PasswordDeriveBytes.cs
- BaseValidatorDesigner.cs
- TypeNameParser.cs
- ValueExpressions.cs
- AccessorTable.cs
- DNS.cs
- XmlEncodedRawTextWriter.cs
- TailCallAnalyzer.cs
- HatchBrush.cs
- XmlDataSourceView.cs
- BitmapCache.cs
- LinqDataSourceSelectEventArgs.cs
- MetadataItemEmitter.cs
- UIElement.cs
- UIElementIsland.cs
- altserialization.cs
- WindowsComboBox.cs
- ImageAttributes.cs
- VisualProxy.cs
- XamlParser.cs
- TrackingMemoryStreamFactory.cs
- ProcessModelInfo.cs
- XmlSchemaAttributeGroupRef.cs
- PathData.cs
- ConfigurationManagerInternalFactory.cs
- InputMethod.cs
- CodeAttributeArgument.cs
- InputReferenceExpression.cs
- CultureTableRecord.cs
- SymLanguageVendor.cs
- HostingEnvironmentException.cs
- basevalidator.cs
- ToolStripProgressBar.cs
- PKCS1MaskGenerationMethod.cs
- KeyNotFoundException.cs
- ReferencedCollectionType.cs
- PrinterResolution.cs
- ellipse.cs
- ComNativeDescriptor.cs
- SecurityManager.cs
- DbConnectionPoolCounters.cs
- TreeView.cs
- ServicesUtilities.cs
- BaseResourcesBuildProvider.cs
- InternalDispatchObject.cs
- Size3DValueSerializer.cs
- TableHeaderCell.cs
- SRef.cs
- CopyOfAction.cs
- SatelliteContractVersionAttribute.cs
- SectionInput.cs
- DataRecordInternal.cs
- XPathSingletonIterator.cs
- ICspAsymmetricAlgorithm.cs
- SQLDecimalStorage.cs
- httpapplicationstate.cs