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
- DataGridViewEditingControlShowingEventArgs.cs
- NotifyIcon.cs
- HttpBrowserCapabilitiesWrapper.cs
- Vertex.cs
- KeyPullup.cs
- DeferredSelectedIndexReference.cs
- DiagnosticsElement.cs
- ObjectDataSourceStatusEventArgs.cs
- TextEditorSpelling.cs
- ToolStripSplitStackLayout.cs
- SystemTcpStatistics.cs
- PersonalizationStateInfoCollection.cs
- SqlDeflator.cs
- KeyGestureConverter.cs
- Material.cs
- OdbcError.cs
- TripleDES.cs
- SpotLight.cs
- Brush.cs
- XmlUtil.cs
- VersionedStreamOwner.cs
- EdmType.cs
- TransferRequestHandler.cs
- WindowsClaimSet.cs
- TypeGeneratedEventArgs.cs
- ParameterBuilder.cs
- FullTrustAssembliesSection.cs
- TextPenaltyModule.cs
- RoleService.cs
- Method.cs
- ContourSegment.cs
- HtmlFormWrapper.cs
- OutputCacheSettingsSection.cs
- CatalogPartCollection.cs
- ListBase.cs
- ServiceManagerHandle.cs
- FixedDSBuilder.cs
- ObjectDataSourceSelectingEventArgs.cs
- MessageHeaderException.cs
- DbProviderManifest.cs
- TailCallAnalyzer.cs
- Errors.cs
- ConditionalExpression.cs
- CutCopyPasteHelper.cs
- ImageListStreamer.cs
- SymDocumentType.cs
- HostedElements.cs
- SafeHandle.cs
- Variant.cs
- NullableBoolConverter.cs
- HtmlToClrEventProxy.cs
- Serializer.cs
- ClockController.cs
- CurrencyManager.cs
- JavascriptCallbackResponseProperty.cs
- PermissionAttributes.cs
- CanExecuteRoutedEventArgs.cs
- ProxyGenerator.cs
- HtmlControlPersistable.cs
- CloudCollection.cs
- ContractCodeDomInfo.cs
- MemberRelationshipService.cs
- TypeToken.cs
- EncryptedPackageFilter.cs
- DesignColumnCollection.cs
- CodeRemoveEventStatement.cs
- ContextBase.cs
- EncodingNLS.cs
- PropertyMetadata.cs
- PassportAuthentication.cs
- SimpleRecyclingCache.cs
- TlsnegoTokenProvider.cs
- FormViewInsertEventArgs.cs
- PriorityRange.cs
- Int64AnimationUsingKeyFrames.cs
- XmlSchemaElement.cs
- GridView.cs
- WindowsHyperlink.cs
- ObjectQuery_EntitySqlExtensions.cs
- DictionarySectionHandler.cs
- ReliableSession.cs
- SchemaCompiler.cs
- CodeTypeOfExpression.cs
- PingReply.cs
- ContextMenuAutomationPeer.cs
- RegexRunnerFactory.cs
- ToolStripAdornerWindowService.cs
- IntSecurity.cs
- LayoutTableCell.cs
- StreamGeometryContext.cs
- ThumbButtonInfoCollection.cs
- SafeCertificateContext.cs
- HttpFileCollection.cs
- QilStrConcat.cs
- StaticSiteMapProvider.cs
- SafeCertificateStore.cs
- PrefixHandle.cs
- WeakReadOnlyCollection.cs
- ToolStripDropDownMenu.cs
- ProfileInfo.cs