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
- ResourceIDHelper.cs
- IPHostEntry.cs
- InfoCardAsymmetricCrypto.cs
- GeometryHitTestResult.cs
- SelectionItemPattern.cs
- RichTextBox.cs
- DataTableReader.cs
- TabItem.cs
- LocatorPart.cs
- DocumentPageView.cs
- SqlCachedBuffer.cs
- HttpDictionary.cs
- SafeSerializationManager.cs
- NoPersistProperty.cs
- GACIdentityPermission.cs
- ImageSource.cs
- BookmarkManager.cs
- PackageDigitalSignature.cs
- DetailsViewUpdateEventArgs.cs
- PerformanceCounterCategory.cs
- StylusPointPropertyUnit.cs
- FunctionGenerator.cs
- FixedSOMPage.cs
- AlignmentYValidation.cs
- XmlSchemaExternal.cs
- KeyedHashAlgorithm.cs
- NetworkStream.cs
- MiniParameterInfo.cs
- NumberSubstitution.cs
- RepeaterItemCollection.cs
- ExternalFile.cs
- FreezableOperations.cs
- AsyncWaitHandle.cs
- ContractsBCL.cs
- WeakHashtable.cs
- PageThemeBuildProvider.cs
- CollectionBase.cs
- TimersDescriptionAttribute.cs
- CheckBoxFlatAdapter.cs
- DrawingContextWalker.cs
- RTLAwareMessageBox.cs
- DesignerSerializationManager.cs
- EnterpriseServicesHelper.cs
- FixedLineResult.cs
- TableHeaderCell.cs
- Qualifier.cs
- RowType.cs
- NetSectionGroup.cs
- BindToObject.cs
- FromRequest.cs
- DATA_BLOB.cs
- RawUIStateInputReport.cs
- CodeStatement.cs
- WebPartConnectionsConnectVerb.cs
- Cursor.cs
- PageSetupDialog.cs
- DataSourceControl.cs
- DefaultValueConverter.cs
- FilterRepeater.cs
- EntityTemplateFactory.cs
- NamespaceList.cs
- AllowedAudienceUriElementCollection.cs
- ConfigurationSectionGroup.cs
- InfiniteIntConverter.cs
- ValidationVisibilityAttribute.cs
- ContractValidationHelper.cs
- HttpListenerException.cs
- ToolbarAUtomationPeer.cs
- WebFormsRootDesigner.cs
- DataExpression.cs
- PointAnimationUsingPath.cs
- PrintDialogException.cs
- ListControlConvertEventArgs.cs
- HasCopySemanticsAttribute.cs
- Binding.cs
- BindingSource.cs
- COM2PropertyDescriptor.cs
- ElementsClipboardData.cs
- XmlNode.cs
- CalculatedColumn.cs
- ConfigXmlText.cs
- ServiceContractViewControl.Designer.cs
- AtomParser.cs
- ToolboxItemCollection.cs
- HashJoinQueryOperatorEnumerator.cs
- InkCanvasSelectionAdorner.cs
- QueryContinueDragEvent.cs
- EntityViewContainer.cs
- Positioning.cs
- TableCell.cs
- RangeBaseAutomationPeer.cs
- SQLInt32.cs
- FontConverter.cs
- ColorTransformHelper.cs
- DataChangedEventManager.cs
- DbConnectionHelper.cs
- WindowsFormsHelpers.cs
- Viewport3DVisual.cs
- ListViewCommandEventArgs.cs
- EmissiveMaterial.cs