Пример #1
0
        public void Reading()
        {
            while (Active)
            {
                if (TBook.Count > 0)
                {
                    TB = TBook.Dequeue();
                    //Thread.Sleep(timeBuilding*1000);

                    /*Thread threadBuild1 = new Thread(new ThreadStart(Build));
                     * threadBuild1.Start();*/
                    Journal JIo = new Journal();
                    //Console.WriteLine("АЙДИШНИК " + id);
                    // id++;
                    JIo.IdBook = TB.Id;
                    JIo.TEv    = TypeEvents.Read;
                    //JIo.TimeEvent = DateTime.Now;
                    JIo.typeSender = TypeSender.Technical;
                    BookReaded(JIo);
                    if (readed != null)
                    {
                        readed($"{TB.Name} Read");
                    }
                    Thread threadCl = new Thread(new ThreadStart(CloseBookTechno));
                    threadCl.Start();
                }
                if (FBook.Count > 0)
                {
                    FB = FBook.Dequeue();
                    //Thread.Sleep(timeBuilding*1000);

                    /*Thread threadBuild1 = new Thread(new ThreadStart(Build));
                     * threadBuild1.Start();*/
                    Journal JIo = new Journal();
                    //Console.WriteLine("АЙДИШНИК " + id);
                    // id++;
                    JIo.IdBook = FB.Id;
                    JIo.TEv    = TypeEvents.Read;
                    //JIo.TimeEvent = DateTime.Now;
                    JIo.typeSender = TypeSender.Fiction;
                    if (BookReaded != null)
                    {
                        BookReaded(JIo);
                    }
                    if (readed != null)
                    {
                        readed($"{FB.Name} Read");
                    }
                    Thread threadBuild = new Thread(new ThreadStart(CloseBookFict));
                    threadBuild.Start();
                }
            }
            if (readed != null)
            {
                readed("END READ");
            }
        }
Пример #2
0
        public void AddBook(TechnicalBook current)
        {
            TBook.Enqueue(current);
            Journal JI = new Journal();

            JI.TEv = TypeEvents.Open;
            //Console.WriteLine("АЙДИШНИК " + id);
            JI.typeSender = TypeSender.Technical;
            JI.IdBook     = current.Id;
            JI.TimeEvent  = DateTime.Now;
            if (BookReaded != null)
            {
                BookReaded(JI);
            }
            if (readed != null)
            {
                readed($"{current.Name} In Open");
            }
        }