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
- ToolStripDropDownMenu.cs
- Wizard.cs
- SpeechAudioFormatInfo.cs
- AuthenticationServiceManager.cs
- XmlNodeReader.cs
- ReferenceService.cs
- RenderingEventArgs.cs
- Transform.cs
- EntityClientCacheKey.cs
- PieceNameHelper.cs
- LineServicesCallbacks.cs
- X509ThumbprintKeyIdentifierClause.cs
- XmlNamespaceDeclarationsAttribute.cs
- CompiledELinqQueryState.cs
- AcceleratedTokenProviderState.cs
- BrowserCapabilitiesFactory.cs
- DataServiceEntityAttribute.cs
- DefaultDialogButtons.cs
- DataGridViewTextBoxEditingControl.cs
- WindowsGraphics2.cs
- TemplateGroupCollection.cs
- Package.cs
- SettingsPropertyNotFoundException.cs
- UnknownWrapper.cs
- SemanticResolver.cs
- PropertyTab.cs
- RenderOptions.cs
- ProfileModule.cs
- InstanceOwnerException.cs
- Error.cs
- UxThemeWrapper.cs
- FacetChecker.cs
- SessionParameter.cs
- IOThreadTimer.cs
- ColorAnimationBase.cs
- FlowNode.cs
- TailCallAnalyzer.cs
- DES.cs
- InstanceDataCollectionCollection.cs
- XmlILAnnotation.cs
- GridViewCommandEventArgs.cs
- SoapFormatExtensions.cs
- PackageRelationshipSelector.cs
- HttpListener.cs
- GridViewCancelEditEventArgs.cs
- Baml6Assembly.cs
- SymbolEqualComparer.cs
- PageSetupDialog.cs
- FlowDecisionDesigner.xaml.cs
- CultureInfoConverter.cs
- CheckableControlBaseAdapter.cs
- ColorInterpolationModeValidation.cs
- WindowsListView.cs
- RelatedView.cs
- CompletionBookmark.cs
- WindowsEditBoxRange.cs
- URLIdentityPermission.cs
- JulianCalendar.cs
- SharedConnectionListener.cs
- OptionalRstParameters.cs
- LoadGrammarCompletedEventArgs.cs
- BufferedGenericXmlSecurityToken.cs
- DynamicActivityXamlReader.cs
- CodeSubDirectory.cs
- RtfControlWordInfo.cs
- PartialCachingAttribute.cs
- PathFigureCollectionValueSerializer.cs
- ElapsedEventArgs.cs
- XmlNodeList.cs
- RTLAwareMessageBox.cs
- PriorityItem.cs
- TextRenderer.cs
- UnhandledExceptionEventArgs.cs
- _SSPIWrapper.cs
- FontFamilyIdentifier.cs
- DiagnosticsConfigurationHandler.cs
- WebSysDefaultValueAttribute.cs
- SqlVersion.cs
- Color.cs
- RoutedPropertyChangedEventArgs.cs
- columnmapkeybuilder.cs
- FixedTextPointer.cs
- CalendarTable.cs
- ControlFilterExpression.cs
- LinkArea.cs
- IisTraceListener.cs
- DocumentViewer.cs
- UserPersonalizationStateInfo.cs
- BinHexEncoder.cs
- BinaryVersion.cs
- DataObjectPastingEventArgs.cs
- WhileDesigner.cs
- SessionPageStatePersister.cs
- bidPrivateBase.cs
- ConstructorBuilder.cs
- _FixedSizeReader.cs
- SkewTransform.cs
- GifBitmapDecoder.cs
- UrlParameterReader.cs
- _DomainName.cs