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
- MutexSecurity.cs
- ExplicitDiscriminatorMap.cs
- NotificationContext.cs
- SamlConstants.cs
- LinkClickEvent.cs
- Timer.cs
- VirtualPathUtility.cs
- WriteTimeStream.cs
- SqlBuilder.cs
- WindowsFormsSynchronizationContext.cs
- DiscreteKeyFrames.cs
- PerCallInstanceContextProvider.cs
- HttpRequestTraceRecord.cs
- AnnotationHighlightLayer.cs
- cryptoapiTransform.cs
- CollectionChangeEventArgs.cs
- RestHandlerFactory.cs
- URL.cs
- LineBreakRecord.cs
- DataKeyCollection.cs
- PropertyRef.cs
- wmiprovider.cs
- NameValueFileSectionHandler.cs
- Int32EqualityComparer.cs
- TextBlock.cs
- SafePEFileHandle.cs
- StateManager.cs
- FunctionCommandText.cs
- NavigationFailedEventArgs.cs
- codemethodreferenceexpression.cs
- WebPartTracker.cs
- IteratorAsyncResult.cs
- FontFaceLayoutInfo.cs
- RoleGroupCollectionEditor.cs
- ResourceContainer.cs
- ClientCultureInfo.cs
- ListViewGroupCollectionEditor.cs
- EntityContainerEntitySetDefiningQuery.cs
- InvalidDataContractException.cs
- Pool.cs
- PageBuildProvider.cs
- DesignerCatalogPartChrome.cs
- EnumMemberAttribute.cs
- Assert.cs
- XmlSchemaChoice.cs
- BaseInfoTable.cs
- DoubleStorage.cs
- FormViewCommandEventArgs.cs
- XsdBuilder.cs
- CheckBoxPopupAdapter.cs
- MergeFilterQuery.cs
- ExcCanonicalXml.cs
- MaskedTextProvider.cs
- QuaternionValueSerializer.cs
- TextParagraph.cs
- PropertyChangingEventArgs.cs
- ReadContentAsBinaryHelper.cs
- DesignerHelpers.cs
- HttpClientCertificate.cs
- ObjectSecurity.cs
- FixedDocumentSequencePaginator.cs
- DataGridViewAdvancedBorderStyle.cs
- GeometryDrawing.cs
- EnvelopedPkcs7.cs
- DataGridViewCellStyleChangedEventArgs.cs
- StringToken.cs
- TextEffectResolver.cs
- XmlArrayItemAttributes.cs
- SimpleBitVector32.cs
- RelatedImageListAttribute.cs
- DataGridViewCellStyleEditor.cs
- DataListItemCollection.cs
- SafeRegistryHandle.cs
- CommandHelpers.cs
- TCEAdapterGenerator.cs
- InteropAutomationProvider.cs
- SBCSCodePageEncoding.cs
- RotateTransform3D.cs
- DataGridViewButtonColumn.cs
- ProcessHostMapPath.cs
- DataGridViewAccessibleObject.cs
- AudioException.cs
- PaintValueEventArgs.cs
- HtmlDocument.cs
- UdpDiscoveryEndpointElement.cs
- DisplayNameAttribute.cs
- ColumnMapVisitor.cs
- AutomationElementCollection.cs
- AppDomainGrammarProxy.cs
- GradientBrush.cs
- SafeNativeMethods.cs
- ActivationArguments.cs
- EncoderBestFitFallback.cs
- BuildProvider.cs
- EntityDescriptor.cs
- StateMachine.cs
- ObjectViewListener.cs
- EventPrivateKey.cs
- PageCatalogPart.cs
- NonBatchDirectoryCompiler.cs