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
- QueryResponse.cs
- SqlReferenceCollection.cs
- PropertyPushdownHelper.cs
- WebPageTraceListener.cs
- WindowsListViewGroupSubsetLink.cs
- PocoEntityKeyStrategy.cs
- DeadCharTextComposition.cs
- SQLMembershipProvider.cs
- EntityObject.cs
- MSHTMLHost.cs
- ErasingStroke.cs
- TrackBarRenderer.cs
- Opcode.cs
- EqualityComparer.cs
- OperandQuery.cs
- FileVersion.cs
- TypeInitializationException.cs
- CompositeScriptReferenceEventArgs.cs
- MemberDescriptor.cs
- SourceElementsCollection.cs
- XmlSchemaNotation.cs
- SystemInfo.cs
- TreeNodeSelectionProcessor.cs
- DisplayInformation.cs
- MobileUserControlDesigner.cs
- BoolLiteral.cs
- EventToken.cs
- XpsSerializationManager.cs
- OdbcTransaction.cs
- OutOfProcStateClientManager.cs
- DisplayNameAttribute.cs
- PolicyChain.cs
- FileDialogCustomPlacesCollection.cs
- ServiceEndpointAssociationProvider.cs
- MulticastIPAddressInformationCollection.cs
- BeginSelectCardRequest.cs
- CodeDirectionExpression.cs
- EventSourceCreationData.cs
- _ListenerAsyncResult.cs
- BamlWriter.cs
- VirtualizedItemPattern.cs
- UpdateCommand.cs
- Point3D.cs
- SqlDataSourceFilteringEventArgs.cs
- HitTestWithPointDrawingContextWalker.cs
- DurableOperationAttribute.cs
- SchemaTableColumn.cs
- ParseChildrenAsPropertiesAttribute.cs
- Attributes.cs
- DocumentNUp.cs
- StartUpEventArgs.cs
- PropertyGridEditorPart.cs
- KeyEvent.cs
- ComponentEditorPage.cs
- BackStopAuthenticationModule.cs
- ContainerParagraph.cs
- DashStyle.cs
- FormViewDeleteEventArgs.cs
- XPathNavigatorKeyComparer.cs
- COSERVERINFO.cs
- TraceUtility.cs
- GroupItemAutomationPeer.cs
- HttpNamespaceReservationInstallComponent.cs
- Metafile.cs
- ScriptServiceAttribute.cs
- DataGridViewTopRowAccessibleObject.cs
- TextSpanModifier.cs
- BamlLocalizableResource.cs
- WebUtil.cs
- WebBrowserUriTypeConverter.cs
- GetIsBrowserClientRequest.cs
- ManipulationStartedEventArgs.cs
- XamlPoint3DCollectionSerializer.cs
- InstanceContext.cs
- MetadataSource.cs
- UnsafeCollabNativeMethods.cs
- VersionedStream.cs
- FaultImportOptions.cs
- DataTableMapping.cs
- KeyTimeConverter.cs
- TextRangeBase.cs
- WebBrowser.cs
- CopyCodeAction.cs
- SqlFacetAttribute.cs
- SignatureDescription.cs
- TrustLevelCollection.cs
- AuthorizationSection.cs
- ValidatorCollection.cs
- sqlinternaltransaction.cs
- PersonalizationEntry.cs
- SqlVersion.cs
- ImpersonationContext.cs
- CodeDOMUtility.cs
- QilVisitor.cs
- TypeReference.cs
- SqlInfoMessageEvent.cs
- PointCollectionValueSerializer.cs
- ContainerControlDesigner.cs
- Utils.cs
- StateMachineWorkflowInstance.cs