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
- SHA384.cs
- CodeChecksumPragma.cs
- ObjectFullSpanRewriter.cs
- OptimizedTemplateContentHelper.cs
- ReadOnlyDataSource.cs
- TableChangeProcessor.cs
- WebPartTracker.cs
- HashAlgorithm.cs
- GenerateTemporaryAssemblyTask.cs
- ContainerFilterService.cs
- WindowsTokenRoleProvider.cs
- ReadOnlyPermissionSet.cs
- MenuStrip.cs
- log.cs
- RegexStringValidator.cs
- RandomDelaySendsAsyncResult.cs
- TextTreeTextElementNode.cs
- XmlRootAttribute.cs
- SuppressMergeCheckAttribute.cs
- MobileListItemCollection.cs
- EventLogPermissionAttribute.cs
- ConfigurationProperty.cs
- MatrixUtil.cs
- DelayedRegex.cs
- DetailsViewPagerRow.cs
- SplineKeyFrames.cs
- EntityDataSourceContextDisposingEventArgs.cs
- Activator.cs
- XmlElementList.cs
- UmAlQuraCalendar.cs
- Run.cs
- PackageRelationship.cs
- TextFormatterHost.cs
- ImageBrush.cs
- OdbcConnectionPoolProviderInfo.cs
- DataServiceResponse.cs
- WebChannelFactory.cs
- xdrvalidator.cs
- WarningException.cs
- SafeReversePInvokeHandle.cs
- HostExecutionContextManager.cs
- TextEffectCollection.cs
- WindowsAltTab.cs
- rsa.cs
- StaticSiteMapProvider.cs
- ForEachAction.cs
- CachedCompositeFamily.cs
- AspNetPartialTrustHelpers.cs
- SubpageParagraph.cs
- ImageSource.cs
- InvokeProviderWrapper.cs
- MultipleViewProviderWrapper.cs
- BuildResult.cs
- MetafileHeaderWmf.cs
- RenderingEventArgs.cs
- IdentitySection.cs
- OutputScopeManager.cs
- PageTheme.cs
- WebPartUtil.cs
- PnrpPermission.cs
- ColumnCollection.cs
- Icon.cs
- AuthenticationModuleElement.cs
- CommentEmitter.cs
- ModuleConfigurationInfo.cs
- DataGridCellEditEndingEventArgs.cs
- ConfigurationLockCollection.cs
- XmlChildEnumerator.cs
- ResXDataNode.cs
- SizeF.cs
- XmlUTF8TextReader.cs
- UnhandledExceptionEventArgs.cs
- HierarchicalDataSourceControl.cs
- EdmComplexTypeAttribute.cs
- XmlNode.cs
- ObjectDataSourceFilteringEventArgs.cs
- ButtonFlatAdapter.cs
- BuildProviderCollection.cs
- Convert.cs
- AccessorTable.cs
- ProfileSettings.cs
- RegistryKey.cs
- KnownTypesProvider.cs
- ConversionContext.cs
- CustomWebEventKey.cs
- PropertyValueUIItem.cs
- GridToolTip.cs
- RegexReplacement.cs
- Point.cs
- MetadataItemCollectionFactory.cs
- ErrorWrapper.cs
- ParseElementCollection.cs
- SqlComparer.cs
- ConsoleTraceListener.cs
- SystemWebCachingSectionGroup.cs
- LineGeometry.cs
- SqlNode.cs
- GeometryModel3D.cs
- URLString.cs
- SmtpClient.cs