Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / MS / Internal / IO / Packaging / TrackingMemoryStreamFactory.cs / 1305600 / TrackingMemoryStreamFactory.cs
//------------------------------------------------------------------------------ // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // This is a basic implementation of the ITrackingMemoryStreamFactory interface // // History: // 07/4/2005: IgorBel: Initial creation. // 11/08/2005: BruceMac: 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
- ModelTreeManager.cs
- UntypedNullExpression.cs
- RNGCryptoServiceProvider.cs
- XsltConvert.cs
- DataControlLinkButton.cs
- ElementAction.cs
- DataGridViewColumnCollection.cs
- ListSourceHelper.cs
- XPathChildIterator.cs
- CustomAttribute.cs
- ByteViewer.cs
- CommandEventArgs.cs
- UIElementPropertyUndoUnit.cs
- LinqDataSourceEditData.cs
- BlurBitmapEffect.cs
- Msec.cs
- XmlSchemaAppInfo.cs
- NonBatchDirectoryCompiler.cs
- SqlUserDefinedAggregateAttribute.cs
- TryExpression.cs
- GeneralTransform3DGroup.cs
- HttpCacheVaryByContentEncodings.cs
- HtmlSelect.cs
- SEHException.cs
- MenuAutoFormat.cs
- PageAsyncTask.cs
- HtmlTableCellCollection.cs
- OpenFileDialog.cs
- XmlRootAttribute.cs
- ToolStripSettings.cs
- ArrayConverter.cs
- TypeLibConverter.cs
- DesignerLinkAdapter.cs
- DrawingContextDrawingContextWalker.cs
- ZoneMembershipCondition.cs
- StylusPointPropertyUnit.cs
- XmlConvert.cs
- QilStrConcatenator.cs
- JpegBitmapDecoder.cs
- DesignerRegionCollection.cs
- OpCodes.cs
- MenuItemStyleCollection.cs
- ObjectDataSourceDisposingEventArgs.cs
- PackUriHelper.cs
- NameValueCollection.cs
- ResourceSetExpression.cs
- HeaderUtility.cs
- ListDesigner.cs
- AuthenticationService.cs
- PropertyToken.cs
- WebPartDescription.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- AdornedElementPlaceholder.cs
- XamlBrushSerializer.cs
- EditorZone.cs
- Policy.cs
- Byte.cs
- CryptoApi.cs
- StylusPointPropertyInfoDefaults.cs
- PolyBezierSegment.cs
- ClassHandlersStore.cs
- ColorTranslator.cs
- SingleAnimationUsingKeyFrames.cs
- ViewBase.cs
- Expander.cs
- Classification.cs
- ExeConfigurationFileMap.cs
- ExpressionStringBuilder.cs
- IntSecurity.cs
- AnnotationComponentManager.cs
- ServiceHostingEnvironmentSection.cs
- MonitoringDescriptionAttribute.cs
- InputEventArgs.cs
- ShellProvider.cs
- XmlDictionaryReaderQuotasElement.cs
- OutputChannelBinder.cs
- SoapFaultCodes.cs
- RawStylusInput.cs
- BoundField.cs
- precedingquery.cs
- FontDialog.cs
- IIS7WorkerRequest.cs
- InternalUserCancelledException.cs
- SoapAttributeOverrides.cs
- RawMouseInputReport.cs
- VirtualPathUtility.cs
- Registry.cs
- FixedTextSelectionProcessor.cs
- BitmapDecoder.cs
- DataSourceProvider.cs
- RouteItem.cs
- NamespaceList.cs
- ICollection.cs
- InputBuffer.cs
- TimeoutException.cs
- SoapSchemaMember.cs
- PropertyGrid.cs
- ScriptingRoleServiceSection.cs
- X509Certificate.cs
- SafeNativeMethods.cs