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
- GridViewCommandEventArgs.cs
- XmlSchemaSubstitutionGroup.cs
- HtmlGenericControl.cs
- WebPartConnectionsConnectVerb.cs
- MaskDesignerDialog.cs
- NullableDoubleAverageAggregationOperator.cs
- TimeManager.cs
- XPathNodeIterator.cs
- RegexRunnerFactory.cs
- XmlSchemaSubstitutionGroup.cs
- StatusBarItem.cs
- StringExpressionSet.cs
- Parser.cs
- MD5.cs
- ColorContext.cs
- HttpRequest.cs
- TextAction.cs
- RequestQueue.cs
- NotifyInputEventArgs.cs
- ClientSettingsStore.cs
- XmlSchemaInclude.cs
- StylusButtonCollection.cs
- GreenMethods.cs
- DataGridViewComboBoxCell.cs
- EntityTypeEmitter.cs
- StateMachine.cs
- HttpServerVarsCollection.cs
- ConfigurationException.cs
- XmlSchemaAnnotation.cs
- SchemaElementDecl.cs
- _TLSstream.cs
- IPAddress.cs
- XmlTextReaderImplHelpers.cs
- ProfileProvider.cs
- OleDbRowUpdatingEvent.cs
- XmlSchemaInfo.cs
- EntityViewGenerationAttribute.cs
- InputReferenceExpression.cs
- OleDbConnectionFactory.cs
- ViewStateModeByIdAttribute.cs
- MonthCalendar.cs
- StringExpressionSet.cs
- StrokeSerializer.cs
- _NestedSingleAsyncResult.cs
- SourceCollection.cs
- ProcessModuleCollection.cs
- GridViewRowEventArgs.cs
- ObjectDataSourceDesigner.cs
- AsymmetricKeyExchangeFormatter.cs
- WinEventWrap.cs
- ProfileSettings.cs
- TimelineCollection.cs
- UnsafeMethods.cs
- CompensatableTransactionScopeActivity.cs
- pingexception.cs
- ProxyElement.cs
- EditableLabelControl.cs
- TileModeValidation.cs
- KeyValuePairs.cs
- TreeViewCancelEvent.cs
- RelationshipSet.cs
- KeyValuePairs.cs
- DocumentApplication.cs
- SystemWebSectionGroup.cs
- CacheMemory.cs
- SqlFunctionAttribute.cs
- Cursor.cs
- TemplatedAdorner.cs
- QueryableFilterUserControl.cs
- HtmlLink.cs
- Constants.cs
- TypedAsyncResult.cs
- WmiInstallComponent.cs
- UnmanagedBitmapWrapper.cs
- DropShadowEffect.cs
- TreeViewTemplateSelector.cs
- EmptyEnumerator.cs
- IteratorFilter.cs
- MapPathBasedVirtualPathProvider.cs
- WorkflowApplicationTerminatedException.cs
- Package.cs
- WSAddressing10ProblemHeaderQNameFault.cs
- CombinedGeometry.cs
- ReturnType.cs
- Odbc32.cs
- SoapTypeAttribute.cs
- TraceSection.cs
- Trace.cs
- DataGridItem.cs
- SelectionManager.cs
- ByteRangeDownloader.cs
- ClientConfigurationHost.cs
- CommandLineParser.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- PathFigureCollection.cs
- TemplateKey.cs
- TypeRestriction.cs
- DesignerProperties.cs
- CreateUserErrorEventArgs.cs
- CatalogZoneBase.cs