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
- ResXResourceWriter.cs
- AuthenticationSection.cs
- ListItemsPage.cs
- EntryIndex.cs
- FileLevelControlBuilderAttribute.cs
- DynamicDiscoveryDocument.cs
- GenerateHelper.cs
- ListViewTableRow.cs
- RightNameExpirationInfoPair.cs
- PropertyChangedEventArgs.cs
- DBDataPermission.cs
- DataGridAutoFormat.cs
- UnsafeNativeMethods.cs
- DataGridViewCellCancelEventArgs.cs
- Classification.cs
- SingleAnimationBase.cs
- StylusEventArgs.cs
- ValidatorUtils.cs
- XmlUTF8TextWriter.cs
- DataGridViewIntLinkedList.cs
- FileSystemInfo.cs
- PasswordTextContainer.cs
- EntityKeyElement.cs
- PolicyStatement.cs
- ListDictionary.cs
- Vector.cs
- DefaultSection.cs
- DataObjectPastingEventArgs.cs
- TextContainer.cs
- StylusDevice.cs
- InternalMappingException.cs
- DefaultPropertyAttribute.cs
- UnauthorizedWebPart.cs
- NetDataContractSerializer.cs
- SqlDataSourceCache.cs
- DataTableMappingCollection.cs
- GorillaCodec.cs
- WebPartCatalogCloseVerb.cs
- CodeComment.cs
- RTLAwareMessageBox.cs
- XslException.cs
- ListBindingHelper.cs
- PropertyIDSet.cs
- CachingParameterInspector.cs
- CryptoApi.cs
- GPStream.cs
- MenuTracker.cs
- SettingsSavedEventArgs.cs
- ClientScriptManager.cs
- View.cs
- BezierSegment.cs
- RadioButton.cs
- _SafeNetHandles.cs
- AttachedPropertyBrowsableAttribute.cs
- PopupRoot.cs
- RSAPKCS1SignatureFormatter.cs
- OracleTimeSpan.cs
- HostedNamedPipeTransportManager.cs
- CodeTypeMember.cs
- ControllableStoryboardAction.cs
- FileRegion.cs
- XsltFunctions.cs
- SizeValueSerializer.cs
- ImageClickEventArgs.cs
- WebReferencesBuildProvider.cs
- WebPartExportVerb.cs
- MailAddressCollection.cs
- Model3DGroup.cs
- DocumentXPathNavigator.cs
- Condition.cs
- CapabilitiesSection.cs
- Int32Rect.cs
- ProcessManager.cs
- XmlNavigatorStack.cs
- UrlAuthorizationModule.cs
- _AutoWebProxyScriptHelper.cs
- ByteAnimationBase.cs
- PrintController.cs
- SurrogateSelector.cs
- SamlAuthorityBinding.cs
- CounterCreationDataCollection.cs
- PromptEventArgs.cs
- Baml2006ReaderContext.cs
- DetailsView.cs
- FileSystemInfo.cs
- DesignerVerb.cs
- BulletedListEventArgs.cs
- XPathNode.cs
- FloatUtil.cs
- ObjectQueryState.cs
- WindowsFormsHostPropertyMap.cs
- TransactionState.cs
- SuppressMessageAttribute.cs
- PackagePart.cs
- QueueProcessor.cs
- RtfToken.cs
- SyntaxCheck.cs
- X509Extension.cs
- RegexCharClass.cs
- PathFigure.cs