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
- LoginAutoFormat.cs
- TripleDES.cs
- ProcessModelSection.cs
- RTLAwareMessageBox.cs
- Nullable.cs
- MouseActionValueSerializer.cs
- AmbientValueAttribute.cs
- VirtualizedItemProviderWrapper.cs
- TreeNodeStyle.cs
- CapiNative.cs
- ColumnMapTranslator.cs
- SoundPlayer.cs
- ConfigXmlText.cs
- ListParagraph.cs
- XamlToRtfWriter.cs
- UITypeEditor.cs
- EventArgs.cs
- DocumentApplicationJournalEntry.cs
- AssociationSetMetadata.cs
- TypeUnloadedException.cs
- FormClosingEvent.cs
- XmlResolver.cs
- VectorConverter.cs
- DesignerActionPanel.cs
- RestClientProxyHandler.cs
- PropertyGrid.cs
- DetailsViewRowCollection.cs
- HttpDebugHandler.cs
- SqlDependency.cs
- ToolBar.cs
- SystemParameters.cs
- ComplexBindingPropertiesAttribute.cs
- SAPIEngineTypes.cs
- CfgRule.cs
- StrongNameUtility.cs
- Oid.cs
- ToolStripSettings.cs
- ToolStripArrowRenderEventArgs.cs
- UrlAuthorizationModule.cs
- _LoggingObject.cs
- loginstatus.cs
- BaseInfoTable.cs
- ExpressionEditorSheet.cs
- ComponentDispatcherThread.cs
- Boolean.cs
- OutputScopeManager.cs
- PointLight.cs
- WCFBuildProvider.cs
- HostUtils.cs
- PagesSection.cs
- InstancePersistenceException.cs
- TiffBitmapEncoder.cs
- XamlFigureLengthSerializer.cs
- Enum.cs
- Source.cs
- WindowsRichEdit.cs
- Error.cs
- ProtocolInformationWriter.cs
- StylusOverProperty.cs
- RequestCachingSection.cs
- XmlAggregates.cs
- SqlDataSourceCache.cs
- CompilationUnit.cs
- DtdParser.cs
- AsyncCompletedEventArgs.cs
- Ref.cs
- TextElement.cs
- ManipulationCompletedEventArgs.cs
- ResizeGrip.cs
- SQLDouble.cs
- PackagePartCollection.cs
- mactripleDES.cs
- RegistryHandle.cs
- SafeNativeMethodsOther.cs
- HandlerWithFactory.cs
- RichTextBox.cs
- SwitchLevelAttribute.cs
- WaitHandleCannotBeOpenedException.cs
- OpacityConverter.cs
- SecurityResources.cs
- MemberHolder.cs
- TemplatePropertyEntry.cs
- SecurityManager.cs
- ProjectionPathSegment.cs
- QueryParameter.cs
- NamedPipeTransportSecurityElement.cs
- Pair.cs
- EncryptedType.cs
- FindResponse.cs
- ImmutableObjectAttribute.cs
- SQLRoleProvider.cs
- ComponentResourceManager.cs
- InsufficientMemoryException.cs
- TextFormatter.cs
- SchemaElement.cs
- ButtonBaseDesigner.cs
- CodeNamespaceCollection.cs
- DefaultTextStore.cs
- WaitHandle.cs
- TcpChannelHelper.cs