예제 #1
0
        public void Fill_Cover_Image_List()
        {
            book_node iterator = root;

            while (iterator != null)
            {
                iterator.book.Cover_Pic_to_Image_List();
                iterator = iterator.next;
            }
        }
예제 #2
0
        public void Hide_All_Book_Objects()
        {
            book_node iterator = root;

            while (iterator != null)
            {
                iterator.book.Info.Hide_Info();
                iterator = iterator.next;
            }
        }
예제 #3
0
        public void Deselect_All_Infos()
        {
            book_node iterator = root;

            while (iterator != null)
            {
                iterator.book.Info.Deselect_Book_Info();
                iterator = iterator.next;
            }
        }
예제 #4
0
        public void Draw_All_Books_For_Shelf(ref int point_x)
        {
            point_x = 65;
            book_node iterator = root;

            while (iterator != null)
            {
                iterator.book.Book_shelf_info.Draw_Book_Obj(ref point_x);
                iterator.book.Book_shelf_info.Show();
                iterator = iterator.next;
            }
        }
예제 #5
0
        public void Draw_All_Books()
        {
            Book.point_y = 5;

            book_node iterator = root;

            while (iterator != null)
            {
                iterator.book.Info.Draw_Book_Obj(ref Book.point_y);
                iterator.book.Info.Show();
                iterator = iterator.next;
            }
        }
예제 #6
0
        public void Delete_All_List()
        {
            book_node iterator = root;
            book_node current;

            while (iterator != null)
            {
                current = iterator.next;
                iterator.book.Info.Dispose();
                iterator.book = null;
                iterator      = current;
            }
            root = null;
        }
예제 #7
0
        public Book Find_Book_By_Chosen()
        {
            book_node iterator = root;

            while (iterator != null)
            {
                if (iterator.book.Info.Chosen == true)
                {
                    return(iterator.book);
                }
                iterator = iterator.next;
            }

            return(null);
        }
예제 #8
0
        public void Add_Book_to_List(Book book)
        {
            if (root == null)
            {
                root = new book_node(book);
                return;
            }

            book_node iterator = root;

            while (iterator.next != null)
            {
                iterator = iterator.next;
            }

            iterator.next = new book_node(book);
        }
예제 #9
0
        public void Delete_All_Books_From_Shelf()
        {
            book_node iterator = root;
            book_node current;

            while (iterator != null)
            {
                current = iterator.next;
                iterator.book.Book_shelf_info.Dispose();
                iterator.book = null;
                iterator      = current;
            }
            root = null;

            GC.WaitForPendingFinalizers();
            GC.Collect();
        }
예제 #10
0
        public Book Find_Book_By_ID(int book_id)
        {
            if (root == null)
            {
                return(null);
            }

            book_node iterator = root;

            while (iterator.book.Book_id != book_id)
            {
                if (iterator.next == null)
                {
                    return(null);
                }

                iterator = iterator.next;
            }

            return(iterator.book);
        }
예제 #11
0
        public void Delete_Book_from_List(int book_id, bool delete_picture)
        {
            book_node iterator = root;

            if (root == null)
            {
                return;
            }

            if (root.book.Book_id == book_id)
            {
                root.book.Delete();
                if (delete_picture == true)
                {
                    Picture_Events.Delete_The_Picture(root.book.Cover_path_file);
                }
                root.book = null;
                root      = root.next;
                return;
            }

            while (iterator.next.book.Book_id != book_id)
            {
                iterator = iterator.next;
                if (iterator.next == null)
                {
                    MessageBox.Show("CANT FOUND");
                    return;
                }
            }

            iterator.next.book.Delete();
            if (delete_picture == true)
            {
                Picture_Events.Delete_The_Picture(iterator.next.book.Cover_path_file);
            }
            iterator.next.book = null;
            iterator.next      = iterator.next.next;
            return;
        }
예제 #12
0
 public Book_List()
 {
     root = null;
 }
예제 #13
0
 public book_node(Book b)
 {
     this.book = b;
     this.next = null;
 }