Пример #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";
        }
Пример #2
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);
 }
Пример #3
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;
        }
Пример #4
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);
            }
        }
Пример #5
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);
        }
Пример #6
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);
            }
        }
Пример #7
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);
            }
        }
Пример #8
0
        public void ShowImage(DataBase.Image img)
        {
            if (null != img)
            {
                this.pictureBox1.Image = img.Picture;
                this.pictureBox1.Width = img.Picture.Width;
                this.pictureBox1.Height = img.Picture.Height;
                this.image = img;

                switch (img.ImageType)
                {
                    case EnumImageCategories.FrontImage:
                        this.coverProperties.Width = 120;
                        this.coverProperties.Height = 120;
                        this.printDocument.DefaultPageSettings.Landscape = true;
                        break;
                    case EnumImageCategories.BackImage:
                        this.coverProperties.Width = 151;
                        this.coverProperties.Height = 118;
                        this.printDocument.DefaultPageSettings.Landscape = false;
                        break;
                    default:
                        break;
                }

                base.OnSourceChanged(EventArgs.Empty);
            }
            else
            {
                this.pictureBox1.Image = null;
            }

            this.panel1_Resize(null, EventArgs.Empty);
        }