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
- ZipFileInfo.cs
- DesignerWebPartChrome.cs
- SizeChangedEventArgs.cs
- AmbientEnvironment.cs
- SymbolTable.cs
- CheckBox.cs
- EndpointBehaviorElementCollection.cs
- HwndKeyboardInputProvider.cs
- RawStylusInputCustomData.cs
- VideoDrawing.cs
- StructuredTypeEmitter.cs
- WebPartConnectionsConfigureVerb.cs
- JsonFormatWriterGenerator.cs
- SafeSerializationManager.cs
- TreeViewImageGenerator.cs
- Wizard.cs
- TokenBasedSet.cs
- HashMembershipCondition.cs
- UIPermission.cs
- IncrementalCompileAnalyzer.cs
- SettingsPropertyNotFoundException.cs
- ExpressionStringBuilder.cs
- HtmlTableRowCollection.cs
- ImageMapEventArgs.cs
- CompilerResults.cs
- BitmapEffectDrawingContextState.cs
- PermissionRequestEvidence.cs
- EntityParameterCollection.cs
- RolePrincipal.cs
- SqlDataReader.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- BufferBuilder.cs
- OAVariantLib.cs
- CodeDirectiveCollection.cs
- LocalValueEnumerator.cs
- PeerNameRecord.cs
- dbdatarecord.cs
- WebPartsSection.cs
- NumberFunctions.cs
- FillRuleValidation.cs
- MasterPageParser.cs
- Message.cs
- _TransmitFileOverlappedAsyncResult.cs
- Asn1Utilities.cs
- SrgsRuleRef.cs
- ErrorStyle.cs
- UserUseLicenseDictionaryLoader.cs
- Simplifier.cs
- WorkflowQueuingService.cs
- FlowLayout.cs
- ObjectDataSourceEventArgs.cs
- XPathParser.cs
- CompilerParameters.cs
- DataBoundControl.cs
- TagPrefixCollection.cs
- JavascriptCallbackResponseProperty.cs
- SQLInt32Storage.cs
- TailPinnedEventArgs.cs
- ProjectionPlan.cs
- ConfigurationStrings.cs
- Model3DGroup.cs
- ResourceDictionary.cs
- Transform3D.cs
- SafeMemoryMappedViewHandle.cs
- ConfigXmlReader.cs
- DataGridViewCellCancelEventArgs.cs
- XmlSchemaComplexContent.cs
- CachedFontFamily.cs
- CompositeFontInfo.cs
- SecureUICommand.cs
- FileUtil.cs
- EffectiveValueEntry.cs
- QueryResponse.cs
- XmlResolver.cs
- TimelineClockCollection.cs
- StsCommunicationException.cs
- StrokeSerializer.cs
- RuntimeConfig.cs
- ConfigurationElementProperty.cs
- WebEventTraceProvider.cs
- RegisteredExpandoAttribute.cs
- ToolStripArrowRenderEventArgs.cs
- InstanceCollisionException.cs
- SqlUDTStorage.cs
- SchemaElementLookUpTable.cs
- TransactionProtocolConverter.cs
- DockingAttribute.cs
- ObjectHandle.cs
- ParsedAttributeCollection.cs
- DES.cs
- PrintPageEvent.cs
- Point3D.cs
- Policy.cs
- ConstantCheck.cs
- CryptoKeySecurity.cs
- SemaphoreFullException.cs
- DataGrid.cs
- Drawing.cs
- HwndSubclass.cs
- SkipStoryboardToFill.cs