Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- DataBindingCollection.cs
- XmlSerializerAssemblyAttribute.cs
- HttpVersion.cs
- MethodCallTranslator.cs
- CheckBoxField.cs
- ZipIOExtraFieldZip64Element.cs
- SelectionUIService.cs
- WebPartEditorApplyVerb.cs
- TypeSystemProvider.cs
- TextureBrush.cs
- PersonalizationAdministration.cs
- AnnouncementInnerClient11.cs
- MobileControlsSectionHelper.cs
- BuildManagerHost.cs
- ItemsChangedEventArgs.cs
- GridViewRowCollection.cs
- Native.cs
- DataGridViewLinkCell.cs
- SoapTransportImporter.cs
- FunctionDetailsReader.cs
- SystemGatewayIPAddressInformation.cs
- SHA384Managed.cs
- CollectionViewGroupRoot.cs
- IntSecurity.cs
- Cast.cs
- ReliableDuplexSessionChannel.cs
- ImportContext.cs
- RectKeyFrameCollection.cs
- DrawTreeNodeEventArgs.cs
- Underline.cs
- ListViewItem.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- SystemUnicastIPAddressInformation.cs
- IPGlobalProperties.cs
- LogPolicy.cs
- Hash.cs
- DnsEndPoint.cs
- counter.cs
- HtmlEmptyTagControlBuilder.cs
- DataList.cs
- AuthenticationConfig.cs
- ConfigurationErrorsException.cs
- SqlDataSource.cs
- ToolBar.cs
- AutoFocusStyle.xaml.cs
- TraceSection.cs
- _DigestClient.cs
- ProfessionalColors.cs
- XMLSyntaxException.cs
- TableCell.cs
- RijndaelManagedTransform.cs
- AssemblySettingAttributes.cs
- FileNotFoundException.cs
- StylusPointCollection.cs
- __FastResourceComparer.cs
- ICollection.cs
- LifetimeServices.cs
- ArrayElementGridEntry.cs
- CodeTryCatchFinallyStatement.cs
- Compilation.cs
- DecoratedNameAttribute.cs
- XmlUnspecifiedAttribute.cs
- DataGridClipboardHelper.cs
- InOutArgumentConverter.cs
- ControlsConfig.cs
- ChangeConflicts.cs
- ReachIDocumentPaginatorSerializer.cs
- IntegrationExceptionEventArgs.cs
- BasicExpandProvider.cs
- ImageMapEventArgs.cs
- HttpPostedFile.cs
- PartitionResolver.cs
- RemoteWebConfigurationHost.cs
- LayoutInformation.cs
- XmlUtilWriter.cs
- HttpListenerPrefixCollection.cs
- UnmanagedMemoryStream.cs
- PropertyMetadata.cs
- CallbackValidatorAttribute.cs
- NumericUpDownAccelerationCollection.cs
- MimeBasePart.cs
- PathFigureCollection.cs
- cookiecollection.cs
- TransferRequestHandler.cs
- TemplateBaseAction.cs
- WindowsToolbarAsMenu.cs
- DataGridView.cs
- Button.cs
- LocalizableAttribute.cs
- WebConfigurationManager.cs
- Solver.cs
- Block.cs
- LinqToSqlWrapper.cs
- StylusPointPropertyInfoDefaults.cs
- IISMapPath.cs
- FrameworkContentElement.cs
- ModuleBuilder.cs
- SystemInformation.cs
- PassportAuthentication.cs
- RolePrincipal.cs