Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- ControlCachePolicy.cs
- LogStore.cs
- WebPartDescription.cs
- Style.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- CounterCreationData.cs
- GroupBox.cs
- MediaCommands.cs
- XmlSchemaDatatype.cs
- BuildProvidersCompiler.cs
- Utils.cs
- SecurityProtocolFactory.cs
- DataGridViewCellPaintingEventArgs.cs
- EventSinkHelperWriter.cs
- RoutingUtilities.cs
- DataControlHelper.cs
- _NegoState.cs
- XmlSchemaComplexType.cs
- LocatorManager.cs
- SqlNotificationRequest.cs
- SqlDataSourceCustomCommandPanel.cs
- ValidationEventArgs.cs
- CssClassPropertyAttribute.cs
- WebSysDefaultValueAttribute.cs
- IriParsingElement.cs
- RowsCopiedEventArgs.cs
- DomainUpDown.cs
- TagMapInfo.cs
- NativeMethods.cs
- DetailsViewRow.cs
- WindowsGraphics2.cs
- _NegotiateClient.cs
- TableItemStyle.cs
- AnnouncementService.cs
- PlaceHolder.cs
- EventLogger.cs
- WebServiceResponseDesigner.cs
- CollectionCodeDomSerializer.cs
- BindingElement.cs
- TextRunTypographyProperties.cs
- Predicate.cs
- FileUtil.cs
- RightsDocument.cs
- StreamGeometry.cs
- HorizontalAlignConverter.cs
- XmlTextWriter.cs
- ReachBasicContext.cs
- PaperSize.cs
- SrgsToken.cs
- GroupBoxRenderer.cs
- Operators.cs
- OrderablePartitioner.cs
- MSAANativeProvider.cs
- CaseInsensitiveOrdinalStringComparer.cs
- Matrix3D.cs
- EntityDataSourceQueryBuilder.cs
- activationcontext.cs
- PointLight.cs
- MailSettingsSection.cs
- PropertyInformationCollection.cs
- ObjectDataSource.cs
- DescendantQuery.cs
- QueueProcessor.cs
- BmpBitmapDecoder.cs
- ConnectionPointCookie.cs
- SqlConnectionManager.cs
- SmiRequestExecutor.cs
- HebrewCalendar.cs
- InvalidTimeZoneException.cs
- LinkButton.cs
- BoolExpressionVisitors.cs
- CacheDependency.cs
- Transaction.cs
- SafeCryptHandles.cs
- CopyOnWriteList.cs
- ConfigXmlElement.cs
- InvokeBase.cs
- DbCommandDefinition.cs
- BufferCache.cs
- IResourceProvider.cs
- ModelVisual3D.cs
- ServiceThrottle.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- VisualStyleRenderer.cs
- GlyphRunDrawing.cs
- MatrixTransform.cs
- TemplateParser.cs
- SchemaInfo.cs
- TabControl.cs
- __ConsoleStream.cs
- DrawingImage.cs
- ClickablePoint.cs
- DependencyPropertyHelper.cs
- ThaiBuddhistCalendar.cs
- ColumnResult.cs
- GridViewHeaderRowPresenter.cs
- SqlConnectionPoolGroupProviderInfo.cs
- BrowserCapabilitiesCompiler.cs
- TableChangeProcessor.cs
- Point3DAnimationBase.cs