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
- CheckBox.cs
- X509CertificateCollection.cs
- MexHttpsBindingElement.cs
- ProfileGroupSettings.cs
- TypeDependencyAttribute.cs
- XmlWhitespace.cs
- OleDbConnection.cs
- PersistenceTypeAttribute.cs
- MemberRestriction.cs
- EmbeddedMailObjectsCollection.cs
- JoinElimination.cs
- RangeValueProviderWrapper.cs
- Context.cs
- ButtonFieldBase.cs
- TextBoxAutoCompleteSourceConverter.cs
- SQLStringStorage.cs
- DataGridViewDataConnection.cs
- DataRow.cs
- PathSegmentCollection.cs
- PropertyEmitterBase.cs
- PageTheme.cs
- ParseHttpDate.cs
- TransactionChannelFactory.cs
- RadioButtonList.cs
- _ContextAwareResult.cs
- NumberAction.cs
- GroupByQueryOperator.cs
- TranslateTransform3D.cs
- SupportsEventValidationAttribute.cs
- BasicHttpSecurity.cs
- SendMailErrorEventArgs.cs
- HttpWriter.cs
- WSDualHttpSecurityElement.cs
- RNGCryptoServiceProvider.cs
- CodeIndexerExpression.cs
- ApplicationActivator.cs
- Stack.cs
- documentsequencetextpointer.cs
- TableRowGroupCollection.cs
- CodeCatchClauseCollection.cs
- CompoundFileStorageReference.cs
- ListViewDataItem.cs
- PassportAuthentication.cs
- DictationGrammar.cs
- DBSchemaRow.cs
- TableAdapterManagerGenerator.cs
- InternalConfigHost.cs
- XPathNavigatorReader.cs
- FrugalMap.cs
- UIElementHelper.cs
- Base64Decoder.cs
- PrintSchema.cs
- ThaiBuddhistCalendar.cs
- XmlValueConverter.cs
- ZoneLinkButton.cs
- SqlRowUpdatingEvent.cs
- SqlUserDefinedAggregateAttribute.cs
- MethodImplAttribute.cs
- AsyncSerializedWorker.cs
- PagedDataSource.cs
- SmiConnection.cs
- ThemeDictionaryExtension.cs
- FormsAuthenticationTicket.cs
- PairComparer.cs
- StrokeNodeOperations2.cs
- SecurityManager.cs
- PreservationFileWriter.cs
- Stack.cs
- Bidi.cs
- Object.cs
- SafeJobHandle.cs
- Label.cs
- DbTransaction.cs
- StringAttributeCollection.cs
- KeyedPriorityQueue.cs
- XslCompiledTransform.cs
- BufferBuilder.cs
- DataBindingList.cs
- ItemMap.cs
- StateRuntime.cs
- MetadataArtifactLoader.cs
- ProcessRequestArgs.cs
- PathBox.cs
- PresentationAppDomainManager.cs
- CodeAttachEventStatement.cs
- OleDbParameter.cs
- XmlValidatingReaderImpl.cs
- DispatcherHooks.cs
- DataControlButton.cs
- XmlChildEnumerator.cs
- CancellationToken.cs
- ClientFormsIdentity.cs
- Debug.cs
- FontCollection.cs
- ConvertTextFrag.cs
- PixelShader.cs
- EntitySet.cs
- TextAnchor.cs
- AuthenticateEventArgs.cs
- ScriptResourceAttribute.cs