Пример #1
0
        // server constructor
        public BooksDatabase(ByteSender Sender, string FileName, string TransactLogFileName)
        {
            /*NetworkUnit = new ServerBase(ServerIP, Port);
             * NetworkUnit.DataRecieved += new NetworkEventHandler(Update);*/
            Type    = 0;          // 0 is server
            CurData = new List <byte>(256);
            //CurData.Add(Type);

            RealTimeCommit      = true;
            RealTimeUpdate      = true;
            TransactionRequest  = false;
            TransactionApproval = true;
            SaveMode            = DataBaseSaving.RealTime;
            Logging             = DataBaseLogging.RealTime;
            if (Logging != DataBaseLogging.None)
            {
                AppendedLog = new Queue <string>();
            }
            ByteSender = Sender;

            IsUpdating = true;
            Load(FileName);             // Server load from file
            IsUpdating = false;


            this.LocalStorage        = FileName;
            this.TransactLogFileName = TransactLogFileName;
        }
Пример #2
0
        // client constructor
        public BooksDatabase(ByteSender Sender, InvokeDelegate Invoke, byte ClientNumber) : base()
        {
            /*NetworkUnit = new ClientBase(ServerIP, Port);
             * NetworkUnit.DataRecieved += new NetworkEventHandler(Update);*/
            Type    = ClientNumber;
            CurData = new List <byte>(256);
            //CurData.Add(Type);

            RealTimeCommit      = true;
            RealTimeUpdate      = true;
            TransactionRequest  = true;
            TransactionApproval = false;
            SaveMode            = DataBaseSaving.None;
            Logging             = DataBaseLogging.None;
            ByteSender          = Sender;

            CurData     = new List <byte>(256);
            this.Invoke = Invoke;
        }