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
- MarshalDirectiveException.cs
- DirectoryObjectSecurity.cs
- SQlBooleanStorage.cs
- ConstraintConverter.cs
- DependencyPropertyHelper.cs
- CompositeFontFamily.cs
- CustomCategoryAttribute.cs
- MappingItemCollection.cs
- FixUpCollection.cs
- PropertyReference.cs
- SspiWrapper.cs
- DropTarget.cs
- WebHeaderCollection.cs
- AutomationIdentifier.cs
- WebPartConnectionsConfigureVerb.cs
- _NestedMultipleAsyncResult.cs
- XslException.cs
- QilReference.cs
- HMACSHA256.cs
- TagPrefixInfo.cs
- HtmlLink.cs
- MultiPageTextView.cs
- TableLayoutPanelCellPosition.cs
- PropertyEntry.cs
- FormViewUpdatedEventArgs.cs
- CompileLiteralTextParser.cs
- PackWebRequest.cs
- RoutedPropertyChangedEventArgs.cs
- mongolianshape.cs
- LayoutEvent.cs
- OperationResponse.cs
- HttpListenerException.cs
- ThemeDirectoryCompiler.cs
- HMACSHA512.cs
- XmlChildNodes.cs
- PaperSource.cs
- CorrelationActionMessageFilter.cs
- SmiContext.cs
- ExtenderProvidedPropertyAttribute.cs
- Tag.cs
- DataGridViewColumnEventArgs.cs
- TypeDelegator.cs
- ResetableIterator.cs
- TransformerInfoCollection.cs
- HtmlControlDesigner.cs
- CodeNamespaceImport.cs
- TypefaceMetricsCache.cs
- DataSourceGroupCollection.cs
- SecurityManager.cs
- Main.cs
- DataGridViewLinkCell.cs
- SharingService.cs
- DesignOnlyAttribute.cs
- ForAllOperator.cs
- AssemblyFilter.cs
- CellPartitioner.cs
- IDispatchConstantAttribute.cs
- ParameterCollection.cs
- InteropDesigner.xaml.cs
- NonClientArea.cs
- ListMarkerSourceInfo.cs
- MethodAccessException.cs
- XPathDescendantIterator.cs
- CompatibleComparer.cs
- PermissionToken.cs
- SqlBulkCopy.cs
- HandleCollector.cs
- TextServicesContext.cs
- Barrier.cs
- ThreadExceptionDialog.cs
- RawStylusInputReport.cs
- CustomErrorCollection.cs
- ToolStripGrip.cs
- SiteMapProvider.cs
- ServiceModelConfigurationSection.cs
- Configuration.cs
- SByte.cs
- DebuggerAttributes.cs
- DataBoundControlHelper.cs
- DataGridTable.cs
- SqlMethodTransformer.cs
- Double.cs
- Int64AnimationBase.cs
- COM2Enum.cs
- StylusDevice.cs
- ContentFilePart.cs
- ClassValidator.cs
- IdentityNotMappedException.cs
- PriorityItem.cs
- ServiceProviders.cs
- EntityKey.cs
- TaiwanLunisolarCalendar.cs
- SerializerDescriptor.cs
- PersonalizationStateInfoCollection.cs
- TransportReplyChannelAcceptor.cs
- DateTime.cs
- TdsParserStaticMethods.cs
- InstanceKeyCompleteException.cs
- WsatServiceCertificate.cs
- DebugView.cs