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
- ConfigurationStrings.cs
- ReverseInheritProperty.cs
- TextRunTypographyProperties.cs
- XsdDateTime.cs
- RuleSettingsCollection.cs
- XmlDataCollection.cs
- SkipQueryOptionExpression.cs
- SafeHandle.cs
- UpdateProgress.cs
- TypeUnloadedException.cs
- Environment.cs
- ParameterModifier.cs
- MouseGesture.cs
- URIFormatException.cs
- ToolBar.cs
- TextClipboardData.cs
- FormViewUpdateEventArgs.cs
- BitmapInitialize.cs
- DataGridColumn.cs
- DesigntimeLicenseContextSerializer.cs
- PropertyChangingEventArgs.cs
- TextPatternIdentifiers.cs
- CustomLineCap.cs
- WebHostedComPlusServiceHost.cs
- BatchParser.cs
- SqlDependency.cs
- OracleTransaction.cs
- FontUnit.cs
- IndexedSelectQueryOperator.cs
- GenericTypeParameterBuilder.cs
- SpecularMaterial.cs
- InArgument.cs
- AuthenticationService.cs
- ObservableCollectionDefaultValueFactory.cs
- DbParameterCollection.cs
- CategoryNameCollection.cs
- Socket.cs
- HttpCookie.cs
- QueryContinueDragEventArgs.cs
- SqlInfoMessageEvent.cs
- RemotingServices.cs
- PackWebRequestFactory.cs
- VisualTreeHelper.cs
- TypeResolver.cs
- GlyphInfoList.cs
- QueryExpr.cs
- TextDocumentView.cs
- EventDescriptorCollection.cs
- ProcessHostFactoryHelper.cs
- SafeProcessHandle.cs
- ToolStripScrollButton.cs
- ScalarType.cs
- DataControlLinkButton.cs
- TemplateControlBuildProvider.cs
- EditingMode.cs
- ObjectQueryExecutionPlan.cs
- Guid.cs
- SparseMemoryStream.cs
- Mutex.cs
- CaseStatementSlot.cs
- Codec.cs
- NamespaceInfo.cs
- TreeBuilderXamlTranslator.cs
- HyperLinkField.cs
- SqlUDTStorage.cs
- DocumentSequenceHighlightLayer.cs
- DataGridViewLinkColumn.cs
- ListBindingConverter.cs
- WebBrowser.cs
- QuotedPrintableStream.cs
- BaseHashHelper.cs
- DataGridColumn.cs
- ObjectDataSourceFilteringEventArgs.cs
- XmlWrappingWriter.cs
- HostedHttpContext.cs
- BinHexDecoder.cs
- WSHttpBindingElement.cs
- ResXResourceWriter.cs
- SoapHeaderAttribute.cs
- SymbolType.cs
- Vector3DIndependentAnimationStorage.cs
- URLMembershipCondition.cs
- BinaryReader.cs
- ContextBase.cs
- CheckBoxDesigner.cs
- BitmapCodecInfo.cs
- Comparer.cs
- SystemPens.cs
- OutKeywords.cs
- Certificate.cs
- Polygon.cs
- QilLiteral.cs
- FixedSOMTextRun.cs
- ResXFileRef.cs
- GregorianCalendarHelper.cs
- UnitySerializationHolder.cs
- RowVisual.cs
- LassoSelectionBehavior.cs
- ParamArrayAttribute.cs
- TextDecoration.cs