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
- XmlSerializerAssemblyAttribute.cs
- COM2IDispatchConverter.cs
- DependencyPropertyKind.cs
- DSASignatureDeformatter.cs
- OracleNumber.cs
- RuntimeCompatibilityAttribute.cs
- UnknownWrapper.cs
- FontStretches.cs
- RadioButtonAutomationPeer.cs
- NotificationContext.cs
- PropertySegmentSerializationProvider.cs
- CollectionCodeDomSerializer.cs
- NegatedConstant.cs
- WindowsSolidBrush.cs
- SqlDependencyUtils.cs
- CircleHotSpot.cs
- UpdateCommand.cs
- DataRowChangeEvent.cs
- DrawTreeNodeEventArgs.cs
- SqlDataSourceFilteringEventArgs.cs
- DateTimeConverter2.cs
- DateTimeFormatInfo.cs
- PeerInvitationResponse.cs
- NamespaceExpr.cs
- WorkflowMessageEventHandler.cs
- GroupBoxRenderer.cs
- LinkClickEvent.cs
- OracleTimeSpan.cs
- StrongNameIdentityPermission.cs
- TokenBasedSetEnumerator.cs
- DetailsViewRow.cs
- Scheduler.cs
- HttpCookieCollection.cs
- ArgIterator.cs
- OleDbRowUpdatingEvent.cs
- CanExecuteRoutedEventArgs.cs
- PropertyFilterAttribute.cs
- EditingScope.cs
- SeparatorAutomationPeer.cs
- EndOfStreamException.cs
- WebRequestModuleElement.cs
- SocketException.cs
- DtdParser.cs
- ControlBindingsCollection.cs
- RadialGradientBrush.cs
- CustomExpressionEventArgs.cs
- HttpListenerRequestUriBuilder.cs
- OleDbException.cs
- NotificationContext.cs
- ChildTable.cs
- regiisutil.cs
- PeerNameResolver.cs
- PolyLineSegmentFigureLogic.cs
- HttpConfigurationContext.cs
- SQLConvert.cs
- Compress.cs
- FolderNameEditor.cs
- OleDbException.cs
- ExtendedPropertyCollection.cs
- PriorityChain.cs
- ExtensionFile.cs
- DynamicRenderer.cs
- TextSchema.cs
- VersionPair.cs
- propertytag.cs
- Matrix3D.cs
- SqlDataRecord.cs
- ListViewTableCell.cs
- SqlStatistics.cs
- QilGenerator.cs
- BoolExpressionVisitors.cs
- StylusEventArgs.cs
- XmlCustomFormatter.cs
- AudioFormatConverter.cs
- ConditionBrowserDialog.cs
- TTSEngineTypes.cs
- TableCell.cs
- StringUtil.cs
- SettingsPropertyNotFoundException.cs
- TimelineClockCollection.cs
- DesignTimeTemplateParser.cs
- EntityContainerAssociationSetEnd.cs
- XmlLoader.cs
- AppManager.cs
- ValueUtilsSmi.cs
- TextCollapsingProperties.cs
- EntityContainerEntitySet.cs
- ReturnType.cs
- WorkflowMessageEventHandler.cs
- HandlerFactoryCache.cs
- WinEventWrap.cs
- __FastResourceComparer.cs
- __Error.cs
- WebPartConnectionsConfigureVerb.cs
- SQLDateTimeStorage.cs
- SchemaImporter.cs
- NavigationHelper.cs
- ClosableStream.cs
- COM2IPerPropertyBrowsingHandler.cs
- GradientStop.cs