Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Base / MS / Internal / IO / Packaging / TrackingMemoryStreamFactory.cs / 1 / TrackingMemoryStreamFactory.cs
//------------------------------------------------------------------------------ // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // This is a basic implementation of the ITrackingMemoryStreamFactory interface // // History: // 07/4/2005: [....]: Initial creation. // 11/08/2005: [....]: Change namespace // //----------------------------------------------------------------------------- using System; using System.IO; using System.Diagnostics; namespace MS.Internal.IO.Packaging { ////// TrackingMemoryStreamFactory class is used in the Sparse Memory Stream to keep track of the memory Usage /// internal class TrackingMemoryStreamFactory : ITrackingMemoryStreamFactory { public MemoryStream Create() { return new TrackingMemoryStream((ITrackingMemoryStreamFactory)this); } public MemoryStream Create(int capacity) { return new TrackingMemoryStream((ITrackingMemoryStreamFactory)this, capacity); } public void ReportMemoryUsageDelta(int delta) { checked{_bufferedMemoryConsumption += delta;} Debug.Assert(_bufferedMemoryConsumption >=0, "we end up having buffers of negative size"); } internal long CurrentMemoryConsumption { get { return _bufferedMemoryConsumption; } } private long _bufferedMemoryConsumption; } } // 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
- DataRowComparer.cs
- HandlerMappingMemo.cs
- ConnectionAcceptor.cs
- PeerToPeerException.cs
- Int64AnimationUsingKeyFrames.cs
- Material.cs
- CodeNamespace.cs
- Int32Storage.cs
- DesignerLoader.cs
- ImageIndexEditor.cs
- HttpInputStream.cs
- CodeRegionDirective.cs
- XmlUtil.cs
- FrameworkObject.cs
- DataGridViewColumnHeaderCell.cs
- WindowShowOrOpenTracker.cs
- TypedElement.cs
- DataControlImageButton.cs
- PlanCompiler.cs
- DesignerVerb.cs
- Module.cs
- DecoderExceptionFallback.cs
- Visual3D.cs
- Attribute.cs
- PluralizationServiceUtil.cs
- RuntimeArgumentHandle.cs
- CodePrimitiveExpression.cs
- PersonalizationProvider.cs
- JavascriptCallbackResponseProperty.cs
- SlipBehavior.cs
- SqlCacheDependencyDatabaseCollection.cs
- ComponentChangedEvent.cs
- NativeCompoundFileAPIs.cs
- CacheSection.cs
- SiteMapNodeCollection.cs
- DeflateStream.cs
- DoubleKeyFrameCollection.cs
- WebPartCollection.cs
- DiffuseMaterial.cs
- ImportCatalogPart.cs
- SudsCommon.cs
- ExecutionContext.cs
- ApplicationInfo.cs
- PropertyCollection.cs
- KeyTimeConverter.cs
- Blend.cs
- WindowsFormsHostAutomationPeer.cs
- DataGridCellsPresenter.cs
- TrustExchangeException.cs
- BackEase.cs
- SiteMapSection.cs
- EdmValidator.cs
- CompareInfo.cs
- InitialServerConnectionReader.cs
- X509CertificateTrustedIssuerElement.cs
- SqlClientFactory.cs
- TemplateInstanceAttribute.cs
- DoubleLinkListEnumerator.cs
- ServiceCredentials.cs
- CompilerScopeManager.cs
- ReadOnlyCollectionBuilder.cs
- RenderingBiasValidation.cs
- ImageFormatConverter.cs
- StateMachineSubscriptionManager.cs
- NameTable.cs
- DataSourceXmlClassAttribute.cs
- SortAction.cs
- MessageSecurityVersionConverter.cs
- TextBoxAutoCompleteSourceConverter.cs
- CreateRefExpr.cs
- AcceleratedTokenProvider.cs
- FlowLayoutPanelDesigner.cs
- FunctionCommandText.cs
- MetadataItemEmitter.cs
- LedgerEntryCollection.cs
- GuidelineSet.cs
- DataSourceControl.cs
- SqlCommand.cs
- ProtocolElementCollection.cs
- DataKeyArray.cs
- SimpleWebHandlerParser.cs
- WsatConfiguration.cs
- UrlAuthorizationModule.cs
- RSAPKCS1SignatureDeformatter.cs
- PreservationFileReader.cs
- LabelLiteral.cs
- XmlComplianceUtil.cs
- sqlstateclientmanager.cs
- RegexParser.cs
- JoinSymbol.cs
- PeerNameRecordCollection.cs
- BitmapEffectInputData.cs
- XslNumber.cs
- InfoCardTraceRecord.cs
- BroadcastEventHelper.cs
- CheckBoxList.cs
- PropertyEmitterBase.cs
- ToolStripDropDownClosedEventArgs.cs
- DataGridViewRowStateChangedEventArgs.cs
- Hash.cs