FileReservationCollection.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Log / System / IO / Log / FileReservationCollection.cs / 1 / FileReservationCollection.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------
#region Using directives
 
using System;
using System.Collections.Generic; 
using System.Text; 

#endregion 

namespace System.IO.Log
{
    internal class FileReservationCollection : ReservationCollection 
    {
        FileRecordSequence sequence; 
 
        internal FileReservationCollection(FileRecordSequence sequence)
        { 
            this.sequence = sequence;
        }

        internal bool IsMyCollection(FileRecordSequence sequence) 
        {
            return this.sequence == sequence; 
        } 

        protected override void MakeReservation(long reservationSize) 
        {
            this.sequence.AddReservation(reservationSize);
        }
 
        protected override void FreeReservation(long reservationSize)
        { 
            this.sequence.RemoveReservation(reservationSize); 
        }
 
        internal new long GetBestMatchingReservation(long size)
        {
            long reservation = base.GetBestMatchingReservation(size);
            this.sequence.RemoveReservation(reservation); 
            return reservation;
        } 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK