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
- StorageEntityTypeMapping.cs
- HtmlWindow.cs
- ProfileService.cs
- StrongNamePublicKeyBlob.cs
- shaper.cs
- OracleConnectionFactory.cs
- CollectionTypeElement.cs
- QuaternionRotation3D.cs
- MemberHolder.cs
- ReflectTypeDescriptionProvider.cs
- WmlPanelAdapter.cs
- DecimalAnimationUsingKeyFrames.cs
- SchemaInfo.cs
- SecurityUniqueId.cs
- DirtyTextRange.cs
- DataColumn.cs
- UserNameSecurityTokenParameters.cs
- ThreadLocal.cs
- SafeFreeMibTable.cs
- MenuItemCollectionEditorDialog.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- SafeTokenHandle.cs
- TypeName.cs
- CodeCompileUnit.cs
- ClockGroup.cs
- PathSegment.cs
- WindowsToolbarAsMenu.cs
- AppModelKnownContentFactory.cs
- ToolStripMenuItemCodeDomSerializer.cs
- ScrollBar.cs
- __FastResourceComparer.cs
- UnsafeMethods.cs
- OpCodes.cs
- Latin1Encoding.cs
- SchemaAttDef.cs
- ResourceReferenceExpression.cs
- ServiceRoute.cs
- Binding.cs
- SystemIPv4InterfaceProperties.cs
- SafeSecurityHelper.cs
- BCLDebug.cs
- SafeMemoryMappedViewHandle.cs
- BitmapImage.cs
- PropertyTabAttribute.cs
- CapabilitiesPattern.cs
- SolidBrush.cs
- SrgsToken.cs
- ResolvedKeyFrameEntry.cs
- InstanceContextManager.cs
- EdmFunction.cs
- ActionItem.cs
- MetabaseServerConfig.cs
- TextElementAutomationPeer.cs
- TextFormatterImp.cs
- FrameworkContextData.cs
- DbCommandDefinition.cs
- VirtualDirectoryMapping.cs
- PrintDocument.cs
- AttachmentCollection.cs
- PageCache.cs
- SignatureConfirmationElement.cs
- SafeMILHandle.cs
- SoapFormatExtensions.cs
- ProviderConnectionPoint.cs
- FramingEncoders.cs
- SerializationStore.cs
- QilScopedVisitor.cs
- DBBindings.cs
- VideoDrawing.cs
- ImpersonationContext.cs
- Psha1DerivedKeyGenerator.cs
- ObjectDataSourceDisposingEventArgs.cs
- Int32Converter.cs
- ClipboardProcessor.cs
- X509PeerCertificateAuthentication.cs
- ServiceBuildProvider.cs
- ClientRuntimeConfig.cs
- XmlParserContext.cs
- NativeCppClassAttribute.cs
- CompilerResults.cs
- SessionPageStatePersister.cs
- WebEventTraceProvider.cs
- WebPartActionVerb.cs
- DesignBindingValueUIHandler.cs
- SHA1Managed.cs
- __Error.cs
- CacheManager.cs
- Transform3D.cs
- TextSchema.cs
- SchemaElementDecl.cs
- ActivationArguments.cs
- SubMenuStyleCollection.cs
- IIS7WorkerRequest.cs
- WinInet.cs
- MouseActionConverter.cs
- QuadraticBezierSegment.cs
- cookiecontainer.cs
- LoginCancelEventArgs.cs
- BinaryConverter.cs
- DbQueryCommandTree.cs