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
- UInt32Storage.cs
- DynamicPropertyHolder.cs
- XmlSchema.cs
- BinaryUtilClasses.cs
- FaultCode.cs
- WindowsRichEdit.cs
- PassportPrincipal.cs
- LineServices.cs
- AtomMaterializer.cs
- LongTypeConverter.cs
- HttpRuntimeSection.cs
- SessionConnectionReader.cs
- EntitySetDataBindingList.cs
- FileDataSourceCache.cs
- FormatVersion.cs
- WindowsStatusBar.cs
- TraceListeners.cs
- DataComponentMethodGenerator.cs
- Int16Animation.cs
- EventLogPermissionAttribute.cs
- BinaryObjectReader.cs
- Byte.cs
- StagingAreaInputItem.cs
- CharEntityEncoderFallback.cs
- EventlogProvider.cs
- NamespaceList.cs
- RuntimeTrackingProfile.cs
- XsltInput.cs
- ProcessModelSection.cs
- TableLayoutRowStyleCollection.cs
- WaitForChangedResult.cs
- ProfileParameter.cs
- FaultDesigner.cs
- UnsafeNativeMethods.cs
- ADRoleFactory.cs
- SafeProcessHandle.cs
- TransportSecurityProtocol.cs
- XmlBinaryWriterSession.cs
- XPathNodeInfoAtom.cs
- TextRunCacheImp.cs
- FigureParaClient.cs
- NavigationFailedEventArgs.cs
- HttpServerVarsCollection.cs
- SignatureResourcePool.cs
- TypedTableBaseExtensions.cs
- EnumUnknown.cs
- TextElement.cs
- InkPresenter.cs
- InputGestureCollection.cs
- RegisteredScript.cs
- GridViewSortEventArgs.cs
- SqlTriggerAttribute.cs
- AttributeData.cs
- ListViewTableRow.cs
- CodeAttributeDeclarationCollection.cs
- MailAddressCollection.cs
- SmiRequestExecutor.cs
- ColorTranslator.cs
- StrokeRenderer.cs
- CorrelationResolver.cs
- RectangleGeometry.cs
- TreeView.cs
- XmlException.cs
- ModuleElement.cs
- glyphs.cs
- PolyLineSegment.cs
- WizardPanel.cs
- DataGridViewColumnHeaderCell.cs
- ParsedAttributeCollection.cs
- PingReply.cs
- QuarticEase.cs
- DoubleKeyFrameCollection.cs
- Transform.cs
- ToolStripManager.cs
- RewritingValidator.cs
- EntityDataSourceChangingEventArgs.cs
- FixUp.cs
- httpstaticobjectscollection.cs
- DotExpr.cs
- WebServiceData.cs
- BasicExpandProvider.cs
- WSHttpBindingCollectionElement.cs
- XmlSerializationWriter.cs
- BitmapImage.cs
- MenuBase.cs
- NameValuePermission.cs
- WebServiceHandlerFactory.cs
- XmlDataImplementation.cs
- SortExpressionBuilder.cs
- ProviderConnectionPoint.cs
- PlanCompilerUtil.cs
- DesignerActionVerbList.cs
- HandlerFactoryWrapper.cs
- DoubleUtil.cs
- PageParserFilter.cs
- AvTrace.cs
- LocalizableAttribute.cs
- RunInstallerAttribute.cs
- EditingCommands.cs
- WebPartCloseVerb.cs