Beispiel #1
0
        public FormPropertiesBox(DisksDB.DataBase.DataBase db, Box box)
        {
            this.db = db;
            this.box = box;

            InitializeComponent();

            this.textBoxTitle.Text = this.box.Name;
            this.textBoxDescription.Text = this.box.Description;

            foreach (Object o in db.BoxTypes)
            {
                this.comboBoxBoxType.Items.Add(o);
            }

            for (int i = 0; i < this.comboBoxBoxType.Items.Count; i++)
            {
                if (((BoxType)this.comboBoxBoxType.Items[i]).Id == box.Type.Id)
                {
                    this.comboBoxBoxType.SelectedIndex = i;
                }
            }

            this.imagePanelFront.ImgFact = db.FrontImages;
            this.imagePanelBack.ImgFact = db.BackImages;
            this.imagePanelInlay.ImgFact = db.InlayImages;
            this.imagePanelBack.ShowImage(box.BackCover);
            this.imagePanelFront.ShowImage(box.FrontCover);
            this.imagePanelInlay.ShowImage(box.InlayCover);

            var lst = this.db.BoxTypes;
            this.comboBox1.DataSource = lst;
            this.Text = box.Name + " - Properties";
        }
Beispiel #2
0
 public FormPopertiesCategory(DisksDB.DataBase.Category cat)
     : base()
 {
     this.cat = cat;
     InitializeComponent();
     SetData();
 }
Beispiel #3
0
 public TreeNodeImagesFolder(string name, DisksDB.DataBase.ImageFactory imgFact)
     : base(name, imgFact, false, false, "Images Folder", -1, DateTime.Now, false, false, false, false, true)
 {
     this.ImageIndex = TreeImages.Folder;
     this.SelectedImageIndex = TreeImages.FolderOpen;
     this.imgFact = imgFact;
     this.imgFact.ChildItemAdded += new EventHandlerItemAdded(ChildItemAdded);
     this.imgFact.ChildItemRemoved += new EventHandlerItemRemoved(ChildItemRemoved);
 }
Beispiel #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="d">this disk object</param>
 public TreeNodeDisk(DataBase.Disk d, DisksDB.DataBase.DataBase db)
     : base(d.Name, d, true, true, "CD/DVD Disk", -1, DateTime.Now, true, false, false, false, false)
 {
     this.disk = d;
     this.db = db;
     this.ImageIndex = TreeImages.CD;
     this.SelectedImageIndex = TreeImages.CDOpen;
     this.disk.NameChanged += new EventHandler(NameChanged);
 }
Beispiel #5
0
        public TreeViewImages(DisksDB.DataBase.DataBase db, FormImagePreview prv)
        {
            this.DataBase = db;
            this.prv = prv;
            LoadTree();
            this.ContextMenu.Popup += new EventHandler(ContextMenuPopup);

            this.AllowDrop = true;
            this.DragDrop += new DragEventHandler(TreeViewImages_DragDrop);
        }
Beispiel #6
0
 /// <summary>
 /// Constructs CD Box tree item
 /// </summary>
 /// <param name="db">database</param>
 /// <param name="box">database object of cdbox</param>
 public TreeNodeBox(DisksDB.DataBase.DataBase db, DataBase.Box box, TreeViewCatalog trv)
     : base(box.Name, box, true, true, "CD/DVD Box", -1, DateTime.Now, true, true, false, false, false)
 {
     this.trv = trv;
     this.db = db;
     this.box = box;
     this.ImageIndex = TreeImages.CDBox;
     this.SelectedImageIndex = TreeImages.CDBoxOpen;
     this.box.ChildItemAdded += new EventHandlerItemAdded(ChildItemAdded);
     this.box.ChildItemRemoved += new EventHandlerItemRemoved(ChildItemRemoved);
     this.box.NameChanged += new EventHandler(NameChanged);
     this.box.ChildsChanged += new EventHandler(ChildsChanged);
 }
Beispiel #7
0
        public FormOptions(DisksDB.DataBase.DataBase db)
        {
            this.db = db;
            InitializeComponent();
            this.imageList.Images.Add(MyResources.GetBitmap("database.png"));
            this.imageList.Images.Add(FileIcons.GetSystemIcon(141, true));
            this.imageList.Images.Add(FileIcons.GetSystemIcon(200, true));
            this.listView1.Items[0].ImageIndex = 0;
            this.listView1.Items[1].ImageIndex = 1;
            this.listView1.Items[2].ImageIndex = 2;
            this.comboBox1.DataSource = new DisksDB.DataBase.DBLayersScanner().LoadModules();

            this.checkBoxAllowSync.Checked = SyncServer.Instance.IsRunning;
        }
Beispiel #8
0
        /// <summary>
        /// Constructs TreeNode object from database Category object
        /// </summary>
        /// <param name="db">database object</param>
        /// <param name="cat">category object</param>
        /// <param name="trv">tree view</param>
        public TreeNodeCategory(DisksDB.DataBase.DataBase db, DataBase.Category cat, TreeViewCatalog trv)
            : base(cat.Name, cat, true, true, "Category", -1, DateTime.Now, true, false, true, true, false)
        {
            Debug.Assert(null != trv);

            this.trv = trv;
            this.db = db;
            this.cat = cat;
            this.ImageIndex = TreeImages.Category;
            this.SelectedImageIndex = TreeImages.CategoryOpen;
            this.cat.NameChanged += new EventHandler(NameChanged);
            this.cat.ChildItemAdded += new EventHandlerItemAdded(ChildItemAdded);
            this.cat.ChildItemRemoved += new EventHandlerItemRemoved(ChildItemRemoved);
            this.cat.ChildsChanged += new EventHandler(ChildsChanged);
        }
Beispiel #9
0
        public FormFirstRun(DisksDB.DataBase.DataBase db)
        {
            this.db = db;
            InitializeComponent();

            try
            {
                this.Icon = new Icon(MyResources.GetStream("App.ico"));
                this.pictureBox1.Image = new System.Drawing.Bitmap(MyResources.GetStream("wellcomeImage.png"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
Beispiel #10
0
        public void ShowItem(DisksDB.DataBase.Image image)
        {
            SetItem(image);

            try
            {
                this.pictureBoxImage.Image = image.Picture;
                this.pictureBoxImage.Size = image.Picture.Size;
            }
            catch (Exception)
            {
            }

            this.tabControl1.SelectedTab = this.tabPageImage;
        }
Beispiel #11
0
        public FormCopyDataBase(DisksDB.DataBase.DataBase dataBase)
        {
            this.dataBase = dataBase;

            InitializeComponent();

            try
            {
                this.Icon = new Icon(MyResources.GetStream("database.ico"));
                this.pictureBox1.Image = new System.Drawing.Bitmap(MyResources.GetStream("wellcomeImage.png"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
Beispiel #12
0
 // form submit
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (validateFields() && DisksDB.AddDisk(txtTitle.Text, Int32.Parse(txtLength.Text), txtGenre.Text))
     {
         // add disk to db and show modal
         lblModalTitle.Text = "Successfully Added Disk";
         lblModalBody.Text  = txtTitle.Text + " has been successfully added to the database. Please select an option.";
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "$('#myModal').modal();", true);
         upModal.Update();
     }
     else
     {
         // show error message
         txtErrorMessage.Text = "One or more fields might not have been filled.";
     }
 }
Beispiel #13
0
        public FormNewCDBox(DisksDB.DataBase.DataBase db)
        {
            InitializeComponent();
            FillTypes(db);
            this.frontPage.FillImages(db.FrontImages);
            this.backPage.FillImages(db.BackImages);
            this.inlayPage.FillImages(db.InlayImages);

            try
            {
                this.Icon = new System.Drawing.Icon(MyResources.GetStream("App.ico"));
                this.pictureBox1.Image = new System.Drawing.Bitmap(MyResources.GetStream("wellcomeImage.png"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
Beispiel #14
0
        public FormPropertiesDisk(DisksDB.DataBase.Disk disk, DisksDB.DataBase.DataBase db)
        {
            InitializeComponent();
            this.disk = disk;
            this.textBoxTitle.Text = disk.Name;
            this.textBoxDescription.Text = "";
            this.textBoxDescription.Enabled = false;
            this.imagePanel1.ImgFact = db.DiskImages;

            foreach (DiskType o in db.DiskTypes)
            {
                this.comboBox1.Items.Add(o);
                if (o.Id == disk.Type.Id)
                {
                    this.comboBox1.SelectedItem = o;
                }
            }

            this.imagePanel1.ShowImage(disk.Image);
            this.Text = disk.Name + " - Properties";
        }
Beispiel #15
0
        public FormNewDisk(DisksDB.DataBase.DataBase db, DataBase.Box box)
        {
            this.box = box;

            InitializeComponent();

            FillDrives();
            this.comboBoxDiskType.DataSource = db.DiskTypes;
            this.controlNewCover1.FillImages(db.DiskImages);
            this.textBoxName.Text = box.Name;
            this.diskType = (DiskType)db.DiskTypes[0];

            try
            {
                this.Icon = new System.Drawing.Icon(MyResources.GetStream("dvdbox.ico"));
                this.pictureBox1.Image = new System.Drawing.Bitmap(MyResources.GetStream("wellcomeImage.png"));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
Beispiel #16
0
        public void ShowItem(DisksDB.DataBase.File file)
        {
            SetItem(file);

            this.labelFolderName.Text = file.Name;
            this.labelFolderDate.Text = file.Date.ToString();
            this.tabControl1.SelectedTab = this.tabPageFolder;
        }
Beispiel #17
0
        private void SetItem(DisksDB.DataBase.BaseObject item)
        {
            if (this.activeItem != item)
            {
                if (null != this.activeItem)
                {
                    this.activeItem.NameChanged -= new EventHandler(ItemNameChanged);
                }

                this.activeItem = item;

                item.NameChanged += new EventHandler(ItemNameChanged);
            }
        }
Beispiel #18
0
        public void ShowItem(DisksDB.DataBase.BaseObject baseObject)
        {
            if (null == baseObject)
            {
                return;
            }

            if (baseObject is Disk)
            {
                this.ShowItem((Disk)baseObject);
            }
            else if (baseObject is Box)
            {
                this.ShowItem((Box)baseObject);
            }
            else if (baseObject is File)
            {
                this.ShowItem((File)baseObject);
            }
            else if (baseObject is Category)
            {
                this.ShowItem((Category)baseObject);
            }
            else if (baseObject is DisksDB.DataBase.Image)
            {
                this.ShowItem((DisksDB.DataBase.Image)baseObject);
            }
        }
Beispiel #19
0
        public void ShowItem(DisksDB.DataBase.Box box)
        {
            SetItem(box);

            if (null != box.FrontCover.Picture)
            {
                this.pictureBox2.Image = box.FrontCover.Picture;
            }

            if (null != box.BackCover.Picture)
            {
                this.pictureBox3.Image = box.BackCover.Picture;
            }

            if (null != box.InlayCover.Picture)
            {
                this.pictureBox4.Image = box.InlayCover.Picture;
            }

            this.label3.Text = box.Name;
            this.label4.Text = box.Description;

            this.tabControl1.SelectedTab = this.tabPageBox;
        }
Beispiel #20
0
        public void ShowItem(DisksDB.DataBase.Disk disk)
        {
            SetItem(disk);

            if (null != disk.Image.Picture)
            {
                this.pictureBox1.Image = disk.Image.Picture;
            }

            this.label1.Text = disk.Name;
            this.label2.Text = "";
            this.tabControl1.SelectedTab = this.tabPageDisk;
        }
Beispiel #21
0
        public void ShowItem(DisksDB.DataBase.Category category)
        {
            SetItem(category);

            this.labelCategoryName.Text = category.Name;
            this.labelCategoryDescription.Text = category.Description;
            this.tabControl1.SelectedTab = this.tabPageCategory;
        }
Beispiel #22
0
        private void FillTypes(DisksDB.DataBase.DataBase db)
        {
            if (null == db)
            {
                return;
            }

            var lst = db.BoxTypes;

            this.comboBoxTyp.DataSource = lst;
        }
Beispiel #23
0
        public FormSearch(FormMain mainApp, DisksDB.DataBase.DataBase dataBase)
        {
            InitializeComponent();

            FillComboBoxesItems();

            this.mainApp = mainApp;
            this.dataBase = dataBase;

            this.comboBoxMoreThan.SelectedIndex = 2;
            this.comboBoxLessThan.SelectedIndex = 2;
            this.comboBoxEquals.SelectedIndex = 2;
        }
Beispiel #24
0
 public void SaveConfig(DisksDB.Config.Config cfg)
 {
     cfg.SetValue(this.Name + ".DataBaseFile", this.cfg.DataBaseFile);
 }
Beispiel #25
0
 public void LoadConfig(DisksDB.Config.Config cfg)
 {
     this.cfg.DataBaseFile = cfg.GetValue(this.Name + ".DataBaseFile");
 }