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
- ApplicationSettingsBase.cs
- SoapServerProtocol.cs
- DispatcherSynchronizationContext.cs
- smtppermission.cs
- SecurityElement.cs
- RequestCachingSection.cs
- HierarchicalDataBoundControlAdapter.cs
- ConfigViewGenerator.cs
- ObjectKeyFrameCollection.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- DocumentSchemaValidator.cs
- TemplatingOptionsDialog.cs
- XAMLParseException.cs
- XmlHierarchyData.cs
- InvalidDataException.cs
- Deflater.cs
- SafeSecurityHelper.cs
- Zone.cs
- Compilation.cs
- TraversalRequest.cs
- HtmlUtf8RawTextWriter.cs
- IgnoreDeviceFilterElementCollection.cs
- ArraySubsetEnumerator.cs
- lengthconverter.cs
- PTUtility.cs
- CapacityStreamGeometryContext.cs
- BitmapEffectRenderDataResource.cs
- CssTextWriter.cs
- TreeIterator.cs
- ToolboxDataAttribute.cs
- FileLogRecordEnumerator.cs
- QualificationDataItem.cs
- UserNamePasswordValidator.cs
- _ChunkParse.cs
- AxHost.cs
- RegexCharClass.cs
- ResourceReferenceExpressionConverter.cs
- BaseValidator.cs
- ApplicationHost.cs
- BitmapImage.cs
- DataExpression.cs
- XmlSerializerVersionAttribute.cs
- ProtocolsSection.cs
- WebPartCollection.cs
- RadioButtonPopupAdapter.cs
- ListItemConverter.cs
- XmlBoundElement.cs
- QueryResponse.cs
- ToolStripStatusLabel.cs
- BoundColumn.cs
- Unit.cs
- HostedNamedPipeTransportManager.cs
- ToolboxSnapDragDropEventArgs.cs
- BinaryFormatterWriter.cs
- DataGridViewCellCollection.cs
- DocumentPaginator.cs
- StateInitializationDesigner.cs
- EventWaitHandle.cs
- WorkflowElementDialog.cs
- ProofTokenCryptoHandle.cs
- CompiledRegexRunner.cs
- GlobalItem.cs
- ExceptionRoutedEventArgs.cs
- ScriptDescriptor.cs
- QilReference.cs
- DesignerActionGlyph.cs
- Metafile.cs
- MemberRelationshipService.cs
- PageThemeCodeDomTreeGenerator.cs
- ProviderConnectionPointCollection.cs
- DesignerForm.cs
- MenuItemStyleCollection.cs
- RetrieveVirtualItemEventArgs.cs
- OdbcConnectionString.cs
- XmlChildEnumerator.cs
- Application.cs
- Pair.cs
- ItemList.cs
- Bezier.cs
- ScrollContentPresenter.cs
- MatrixKeyFrameCollection.cs
- CustomValidator.cs
- MetadataUtilsSmi.cs
- RowType.cs
- ZeroOpNode.cs
- GenericWebPart.cs
- PropertyGeneratedEventArgs.cs
- XmlAnyAttributeAttribute.cs
- BindUriHelper.cs
- ConfigPathUtility.cs
- CollectionAdapters.cs
- PointConverter.cs
- WorkflowMarkupSerializerMapping.cs
- UriScheme.cs
- HostProtectionException.cs
- ValidationHelper.cs
- AuthenticationModuleElement.cs
- TreeNodeClickEventArgs.cs
- Win32Exception.cs
- AnnotationObservableCollection.cs