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
- DataGridTable.cs
- CachedRequestParams.cs
- CqlLexerHelpers.cs
- RtfToXamlReader.cs
- LifetimeMonitor.cs
- StateBag.cs
- CachedRequestParams.cs
- RSAOAEPKeyExchangeDeformatter.cs
- InputLanguage.cs
- LambdaCompiler.Binary.cs
- Context.cs
- TabPanel.cs
- SinglePageViewer.cs
- FieldAccessException.cs
- SignedXmlDebugLog.cs
- XmlName.cs
- RenderData.cs
- MasterPageBuildProvider.cs
- ElementProxy.cs
- x509utils.cs
- FragmentNavigationEventArgs.cs
- PkcsUtils.cs
- PropertyRecord.cs
- LogReservationCollection.cs
- DataGridColumnHeaderCollection.cs
- ListViewSortEventArgs.cs
- VerticalAlignConverter.cs
- ModuleBuilder.cs
- ObjectSerializerFactory.cs
- Propagator.Evaluator.cs
- DecoderReplacementFallback.cs
- WindowsSspiNegotiation.cs
- FontFamily.cs
- MethodAccessException.cs
- ServiceNameCollection.cs
- ClrPerspective.cs
- ImageIndexConverter.cs
- LinqToSqlWrapper.cs
- TextBreakpoint.cs
- MasterPageBuildProvider.cs
- TextEditorSelection.cs
- HtmlEmptyTagControlBuilder.cs
- StoreUtilities.cs
- ControlCollection.cs
- NextPreviousPagerField.cs
- DesignerDataConnection.cs
- BasicCellRelation.cs
- Match.cs
- ScrollableControl.cs
- DataGridRowAutomationPeer.cs
- ContainerFilterService.cs
- GcSettings.cs
- ReadOnlyCollectionBase.cs
- JoinTreeSlot.cs
- LayoutManager.cs
- DrawingServices.cs
- HMACMD5.cs
- IndexedSelectQueryOperator.cs
- ButtonBase.cs
- SpotLight.cs
- MailDefinition.cs
- FilteredReadOnlyMetadataCollection.cs
- Config.cs
- ConfigurationException.cs
- ResourceReferenceExpressionConverter.cs
- OutputScopeManager.cs
- SchemaObjectWriter.cs
- ResourceProperty.cs
- HtmlHistory.cs
- DataControlFieldHeaderCell.cs
- FilterQueryOptionExpression.cs
- WsdlInspector.cs
- ReadWriteSpinLock.cs
- SoapObjectWriter.cs
- CommunicationObjectFaultedException.cs
- TextTreeNode.cs
- ClassImporter.cs
- MenuItemCollection.cs
- PresentationAppDomainManager.cs
- SqlFunctionAttribute.cs
- FramingDecoders.cs
- TextElement.cs
- SqlDataSourceCustomCommandPanel.cs
- XPathMessageContext.cs
- ScrollChrome.cs
- SourceFileBuildProvider.cs
- streamingZipPartStream.cs
- ItemsChangedEventArgs.cs
- FlowDocumentReader.cs
- Publisher.cs
- CodeIterationStatement.cs
- ProcessThreadCollection.cs
- LookupBindingPropertiesAttribute.cs
- WebPartConnectionsCancelEventArgs.cs
- HttpProfileGroupBase.cs
- GridViewItemAutomationPeer.cs
- EventLogPermissionAttribute.cs
- UIPermission.cs
- Pkcs7Recipient.cs
- AuthorizationSection.cs