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
- RuntimeEnvironment.cs
- ProviderCommandInfoUtils.cs
- KeyedHashAlgorithm.cs
- LicenseManager.cs
- Win32NamedPipes.cs
- SplineQuaternionKeyFrame.cs
- ClientBuildManager.cs
- TempFiles.cs
- XDRSchema.cs
- RequestResizeEvent.cs
- ValidationError.cs
- DataGridViewComboBoxColumn.cs
- ExpressionLexer.cs
- RegexBoyerMoore.cs
- MessageQueuePermissionAttribute.cs
- XPathAncestorQuery.cs
- EditorPartChrome.cs
- DataRelationCollection.cs
- UnionCqlBlock.cs
- AuthenticatedStream.cs
- GridViewRowEventArgs.cs
- ScriptBehaviorDescriptor.cs
- UserValidatedEventArgs.cs
- CompiledQuery.cs
- ClientScriptManagerWrapper.cs
- TransactionScope.cs
- QueryStatement.cs
- ProxyElement.cs
- CapabilitiesSection.cs
- SqlNamer.cs
- FormViewPagerRow.cs
- SoapEnumAttribute.cs
- Expander.cs
- XmlSchemaDatatype.cs
- XhtmlBasicImageAdapter.cs
- JumpTask.cs
- TransformPatternIdentifiers.cs
- UpdateProgress.cs
- TypeValidationEventArgs.cs
- ToolStripDropDownClosedEventArgs.cs
- CancellableEnumerable.cs
- SqlReorderer.cs
- HttpDictionary.cs
- DispatcherTimer.cs
- XmlSchemaInclude.cs
- EncoderBestFitFallback.cs
- StrokeDescriptor.cs
- QueueException.cs
- MultipleViewPatternIdentifiers.cs
- Dispatcher.cs
- SignedXmlDebugLog.cs
- _ServiceNameStore.cs
- Action.cs
- TcpDuplicateContext.cs
- ValidationErrorCollection.cs
- validation.cs
- DataBoundControlHelper.cs
- MimeReflector.cs
- DictionaryBase.cs
- NativeWindow.cs
- TabletDevice.cs
- complextypematerializer.cs
- ReflectionPermission.cs
- IconConverter.cs
- SqlXml.cs
- UnknownWrapper.cs
- TextSegment.cs
- TaskScheduler.cs
- UIAgentInitializationException.cs
- RootBrowserWindowAutomationPeer.cs
- StringWriter.cs
- DataGridViewCellStyleConverter.cs
- ListViewItem.cs
- XamlTypeMapperSchemaContext.cs
- ClrProviderManifest.cs
- ScriptIgnoreAttribute.cs
- DoubleAnimationUsingKeyFrames.cs
- BulletedList.cs
- TraceUtility.cs
- sortedlist.cs
- DbDataAdapter.cs
- CompilationPass2Task.cs
- BaseDataListDesigner.cs
- AffineTransform3D.cs
- CssClassPropertyAttribute.cs
- ByteRangeDownloader.cs
- ContentTextAutomationPeer.cs
- BmpBitmapDecoder.cs
- FixedSOMPageConstructor.cs
- LocatorPartList.cs
- DurableDispatcherAddressingFault.cs
- UpdatePanel.cs
- SqlStream.cs
- ToolStripGrip.cs
- ServiceHostFactory.cs
- SimpleHandlerBuildProvider.cs
- HttpCapabilitiesEvaluator.cs
- ExecutedRoutedEventArgs.cs
- SelectedDatesCollection.cs
- PageThemeCodeDomTreeGenerator.cs