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
- WorkflowInstanceUnhandledExceptionRecord.cs
- SmiEventSink_Default.cs
- MenuCommand.cs
- TextProperties.cs
- RuntimeWrappedException.cs
- ZeroOpNode.cs
- SystemPens.cs
- COM2ColorConverter.cs
- ModelVisual3D.cs
- SymLanguageType.cs
- DetailsViewUpdateEventArgs.cs
- ArgIterator.cs
- HtmlTitle.cs
- DateTimeConverter.cs
- SizeAnimation.cs
- FormatConvertedBitmap.cs
- CodeExpressionStatement.cs
- CodeAttributeArgumentCollection.cs
- XmlCompatibilityReader.cs
- ColorBlend.cs
- EmptyImpersonationContext.cs
- CodeMemberProperty.cs
- CategoryState.cs
- DataGridTextBox.cs
- PieceNameHelper.cs
- ThreadInterruptedException.cs
- CompressStream.cs
- ItemsControl.cs
- WindowsPrincipal.cs
- DictionaryBase.cs
- PeerApplication.cs
- DoubleStorage.cs
- EncoderFallback.cs
- DataGridViewCellValidatingEventArgs.cs
- XmlSignificantWhitespace.cs
- Point3DAnimation.cs
- IndexedString.cs
- CorruptingExceptionCommon.cs
- XMLSyntaxException.cs
- EnterpriseServicesHelper.cs
- EventLogEntry.cs
- Itemizer.cs
- RegexCompilationInfo.cs
- DeferredSelectedIndexReference.cs
- UpDownBase.cs
- EventQueueState.cs
- Image.cs
- WebResourceUtil.cs
- OrderingQueryOperator.cs
- SQLDecimalStorage.cs
- CookieProtection.cs
- TdsParserSafeHandles.cs
- XamlTemplateSerializer.cs
- DataColumnCollection.cs
- CompareValidator.cs
- PropertyIDSet.cs
- CompensatableTransactionScopeActivity.cs
- NativeMethods.cs
- TransactedBatchContext.cs
- DynamicPropertyReader.cs
- LockRecursionException.cs
- ToolboxBitmapAttribute.cs
- TransformCollection.cs
- RegexCaptureCollection.cs
- ButtonFieldBase.cs
- EntitySetBaseCollection.cs
- FieldAccessException.cs
- XmlSchemaSimpleContentRestriction.cs
- EntityDesignerUtils.cs
- HttpStreamMessageEncoderFactory.cs
- VerbConverter.cs
- SmtpMail.cs
- ProofTokenCryptoHandle.cs
- ReadContentAsBinaryHelper.cs
- ThreadPool.cs
- AuthenticationModulesSection.cs
- DeviceFilterDictionary.cs
- PopupRoot.cs
- HttpModulesSection.cs
- XPathBinder.cs
- AutomationPatternInfo.cs
- CustomBindingElementCollection.cs
- FontFaceLayoutInfo.cs
- IntPtr.cs
- TextWriter.cs
- VisualTarget.cs
- AuthorizationContext.cs
- XmlReflectionMember.cs
- WindowsFormsHost.cs
- Certificate.cs
- SchemaCollectionCompiler.cs
- RevocationPoint.cs
- newitemfactory.cs
- EntityKey.cs
- IdentitySection.cs
- ContainerAction.cs
- SafePEFileHandle.cs
- ModelVisual3D.cs
- MarkupExtensionParser.cs
- WithStatement.cs