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
- RouteTable.cs
- sqlinternaltransaction.cs
- ApplicationFileCodeDomTreeGenerator.cs
- UInt64Storage.cs
- SemanticResolver.cs
- CatalogZoneBase.cs
- BitmapSizeOptions.cs
- LocalBuilder.cs
- SchemaElement.cs
- DocumentGridPage.cs
- Events.cs
- SafeViewOfFileHandle.cs
- DebugInfoGenerator.cs
- SignedXml.cs
- FontFamilyValueSerializer.cs
- DataServiceConfiguration.cs
- AssemblyInfo.cs
- NotificationContext.cs
- ZipIOCentralDirectoryBlock.cs
- SQLBinaryStorage.cs
- Convert.cs
- EntitySetDataBindingList.cs
- DriveNotFoundException.cs
- DataControlFieldHeaderCell.cs
- UITypeEditor.cs
- StateManagedCollection.cs
- RegexMatch.cs
- SystemThemeKey.cs
- TextTreeInsertUndoUnit.cs
- DataGridLinkButton.cs
- TypeLoader.cs
- UpdateCommand.cs
- InputScopeManager.cs
- DrawListViewSubItemEventArgs.cs
- BuilderInfo.cs
- MDIClient.cs
- UMPAttributes.cs
- AnimationClock.cs
- FigureParagraph.cs
- XmlSchemaAppInfo.cs
- FixedSOMTextRun.cs
- ServiceDescriptionImporter.cs
- X509SecurityToken.cs
- MessageQueuePermission.cs
- Fonts.cs
- Debugger.cs
- WebPartTransformerCollection.cs
- OdbcFactory.cs
- CultureSpecificCharacterBufferRange.cs
- LayoutInformation.cs
- BuildProvider.cs
- MetadataArtifactLoaderComposite.cs
- Variant.cs
- recordstatescratchpad.cs
- XmlSchemaAttribute.cs
- WindowsTokenRoleProvider.cs
- ParserOptions.cs
- GenericAuthenticationEventArgs.cs
- BatchServiceHost.cs
- SoapClientProtocol.cs
- StringFunctions.cs
- SimpleRecyclingCache.cs
- ResourceDictionary.cs
- CounterSampleCalculator.cs
- DeflateEmulationStream.cs
- PartitionResolver.cs
- RepeatButton.cs
- SmiContext.cs
- WebRequestModuleElementCollection.cs
- Win32KeyboardDevice.cs
- DataGridViewSortCompareEventArgs.cs
- ServiceErrorHandler.cs
- FormatConvertedBitmap.cs
- Helper.cs
- rsa.cs
- ActivationArguments.cs
- NetCodeGroup.cs
- MissingManifestResourceException.cs
- ReflectionUtil.cs
- EnumMember.cs
- CookieParameter.cs
- PasswordBox.cs
- ServicePrincipalNameElement.cs
- ResXResourceReader.cs
- EdmTypeAttribute.cs
- EntityContainerEmitter.cs
- InternalControlCollection.cs
- EdmItemError.cs
- TdsParser.cs
- TypeUsageBuilder.cs
- UndoUnit.cs
- WindowsTitleBar.cs
- SearchExpression.cs
- TextContainerChangeEventArgs.cs
- InputBuffer.cs
- TransportationConfigurationTypeInstallComponent.cs
- BatchServiceHost.cs
- GB18030Encoding.cs
- XPathNavigatorReader.cs
- IIS7UserPrincipal.cs