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
- ImmutablePropertyDescriptorGridEntry.cs
- MenuBase.cs
- XmlCDATASection.cs
- PathFigure.cs
- DataGridItemEventArgs.cs
- WebBrowserEvent.cs
- FtpWebRequest.cs
- BitStack.cs
- AttributeAction.cs
- ListControl.cs
- PropertyDescriptor.cs
- Geometry.cs
- InternalControlCollection.cs
- AttributeExtensions.cs
- XPathConvert.cs
- Emitter.cs
- Exception.cs
- CallbackTimeoutsBehavior.cs
- InternalControlCollection.cs
- ProgressiveCrcCalculatingStream.cs
- RuleInfoComparer.cs
- ManipulationDelta.cs
- XmlSchemaValidator.cs
- HtmlTitle.cs
- NameValueFileSectionHandler.cs
- HttpErrorTraceRecord.cs
- CallInfo.cs
- XmlSchema.cs
- ReaderContextStackData.cs
- DeclaredTypeElementCollection.cs
- DataGridViewComboBoxColumn.cs
- ControlUtil.cs
- Inflater.cs
- ComponentResourceManager.cs
- InstanceContext.cs
- WithStatement.cs
- DateBoldEvent.cs
- TableColumnCollection.cs
- ReadOnlyDictionary.cs
- ContextMenu.cs
- WebPartTransformerCollection.cs
- XmlSchemaAnnotated.cs
- XPathExpr.cs
- PathStreamGeometryContext.cs
- wgx_commands.cs
- QuaternionRotation3D.cs
- WebServicesInteroperability.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- Stopwatch.cs
- EtwTrace.cs
- CurrencyWrapper.cs
- XmlExtensionFunction.cs
- DrawingState.cs
- FlowDocumentFormatter.cs
- TextWriter.cs
- ToolStripItemTextRenderEventArgs.cs
- XmlIgnoreAttribute.cs
- XhtmlConformanceSection.cs
- BaseCodePageEncoding.cs
- TagPrefixCollection.cs
- LogRecordSequence.cs
- FormParameter.cs
- ParameterBuilder.cs
- CollectionViewGroupInternal.cs
- DynamicResourceExtension.cs
- TextBoxAutoCompleteSourceConverter.cs
- ArrayTypeMismatchException.cs
- FixedSOMPageElement.cs
- X500Name.cs
- SchemaImporter.cs
- DocumentApplication.cs
- TemplateBindingExpressionConverter.cs
- ZipIOLocalFileBlock.cs
- BitHelper.cs
- RemoteArgument.cs
- LayoutEngine.cs
- Directory.cs
- DecoderExceptionFallback.cs
- DataControlButton.cs
- MatrixTransform.cs
- QuaternionAnimation.cs
- XamlTemplateSerializer.cs
- wgx_sdk_version.cs
- ExpressionBuilder.cs
- BamlBinaryReader.cs
- XmlReader.cs
- SoapExtensionReflector.cs
- GroupBox.cs
- PageFunction.cs
- RijndaelCryptoServiceProvider.cs
- FieldBuilder.cs
- AuthorizationSection.cs
- GroupBoxRenderer.cs
- CLSCompliantAttribute.cs
- EmptyStringExpandableObjectConverter.cs
- SponsorHelper.cs
- HtmlDocument.cs
- HMACSHA512.cs
- SecondaryViewProvider.cs
- SessionSwitchEventArgs.cs