Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Shared / MS / Internal / Xaml / Context / XamlFrame.cs / 1305600 / XamlFrame.cs
using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; namespace MS.Internal.Xaml.Context { abstract class XamlFrame { private int _depth; private XamlFrame _previous; protected XamlFrame() { _depth = -1; } // Copy constructor protected XamlFrame(XamlFrame source) { _depth = source._depth; } public virtual XamlFrame Clone() { // Clone should only be overridden for the classes that really need it // ObjectWriterFrame overrides this so we can reuse the context for // Templates. throw new NotImplementedException(); } // Reset the contents of the Frame so it can be reused in a stack without reallocating. // Depth and previous do not change when we reuse the Frame. public abstract void Reset(); public int Depth { get { Debug.Assert(_depth != -1, "Context Frame is uninitialized"); return _depth; } } public XamlFrame Previous { get { return _previous; } set { _previous = value; _depth = (_previous == null) ? 0 : _previous._depth + 1; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; namespace MS.Internal.Xaml.Context { abstract class XamlFrame { private int _depth; private XamlFrame _previous; protected XamlFrame() { _depth = -1; } // Copy constructor protected XamlFrame(XamlFrame source) { _depth = source._depth; } public virtual XamlFrame Clone() { // Clone should only be overridden for the classes that really need it // ObjectWriterFrame overrides this so we can reuse the context for // Templates. throw new NotImplementedException(); } // Reset the contents of the Frame so it can be reused in a stack without reallocating. // Depth and previous do not change when we reuse the Frame. public abstract void Reset(); public int Depth { get { Debug.Assert(_depth != -1, "Context Frame is uninitialized"); return _depth; } } public XamlFrame Previous { get { return _previous; } set { _previous = value; _depth = (_previous == null) ? 0 : _previous._depth + 1; } } } } // 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
- DataGridParentRows.cs
- MediaElementAutomationPeer.cs
- DataGridViewRow.cs
- TransactionScope.cs
- UTF8Encoding.cs
- IssuedTokenClientBehaviorsElement.cs
- XsdDuration.cs
- ProxyAttribute.cs
- NumberFormatInfo.cs
- ControlBindingsCollection.cs
- RouteUrlExpressionBuilder.cs
- Header.cs
- UnsafeNativeMethods.cs
- EdmConstants.cs
- shaperfactory.cs
- TypeSystem.cs
- IPipelineRuntime.cs
- ColorConverter.cs
- InstalledFontCollection.cs
- HtmlFormAdapter.cs
- LiteralText.cs
- UpdatableWrapper.cs
- RefExpr.cs
- _OSSOCK.cs
- IdentityHolder.cs
- VirtualizedContainerService.cs
- DataGridViewTopRowAccessibleObject.cs
- FilterElement.cs
- QilReference.cs
- JournalEntryListConverter.cs
- SHA1CryptoServiceProvider.cs
- PropertyDescriptors.cs
- GPRECTF.cs
- UrlRoutingHandler.cs
- CustomErrorsSectionWrapper.cs
- TextPointerBase.cs
- RSAPKCS1SignatureFormatter.cs
- OdbcException.cs
- Main.cs
- StringCollection.cs
- BoundField.cs
- Vector3DIndependentAnimationStorage.cs
- MemberHolder.cs
- CorePropertiesFilter.cs
- HttpException.cs
- ThreadStaticAttribute.cs
- XhtmlBasicPageAdapter.cs
- DataGridViewColumnConverter.cs
- ConnectionManagementElementCollection.cs
- ContractType.cs
- Random.cs
- DataGridViewMethods.cs
- ScriptServiceAttribute.cs
- MimeMultiPart.cs
- Pen.cs
- TransactionProtocolConverter.cs
- DataMember.cs
- PersonalizationDictionary.cs
- SchemaElementLookUpTableEnumerator.cs
- TransformGroup.cs
- XPathNodePointer.cs
- LocalizableResourceBuilder.cs
- SqlBuilder.cs
- EncryptedReference.cs
- XmlCharType.cs
- Facet.cs
- PageBreakRecord.cs
- Page.cs
- CurrentTimeZone.cs
- ToolStripRenderer.cs
- UnitySerializationHolder.cs
- CachedPathData.cs
- Pipe.cs
- StylusSystemGestureEventArgs.cs
- DetailsViewPageEventArgs.cs
- PropertyRef.cs
- ArrayEditor.cs
- RuntimeHelpers.cs
- WinCategoryAttribute.cs
- SlipBehavior.cs
- RangeValuePattern.cs
- MemberDomainMap.cs
- EmissiveMaterial.cs
- WindowsToolbar.cs
- diagnosticsswitches.cs
- FilterableData.cs
- ConstraintConverter.cs
- FontEditor.cs
- AdornerHitTestResult.cs
- TransformerTypeCollection.cs
- DataBinder.cs
- ReferenceConverter.cs
- UICuesEvent.cs
- Utils.cs
- AQNBuilder.cs
- StylusLogic.cs
- DocumentPageViewAutomationPeer.cs
- ExceptionUtil.cs
- SapiAttributeParser.cs
- CodeCatchClauseCollection.cs