Exemplo n.º 1
0
 public SearchResultRow(string fileName, int fileSize, int fileType, DateTime fileDate, Disk disk, Box box, Category category, string diskName, string boxName, string categoryName)
     : base(fileName)
 {
     this.fileName = fileName;
     this.fileSize = fileSize;
     this.fileType = fileType;
     this.fileDate = fileDate;
     this.disk = disk;
     this.box = box;
     this.category = category;
     this.diskName = diskName;
     this.boxName = boxName;
     this.categoryName = categoryName;
 }
Exemplo n.º 2
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";
        }
Exemplo n.º 3
0
 private void AddingFilesThread()
 {
     try
     {
         this.addedDisk = this.box.AddDisk(this.textBoxName.Text, this.diskType, this.controlNewCover1.Image, this.DriveLetter, this, true);
     }
     catch (Exception ex)
     {
         this.donePage.FinishText = "Error occured while adding Disk \r\n" + ex.Message + ex.StackTrace;
     }
     //this.Invoke(new AddedCDEvent(this.OnAdded));
 }
Exemplo n.º 4
0
 private void AddDisk()
 {
     if (this.checkBoxAddFiles.Checked == true)
     {
         Thread t = new Thread(new ThreadStart(this.AddingFilesThread));
         t.Start();
     }
     else
     {
         this.addedDisk = this.box.AddDisk(this.textBoxName.Text, (DiskType)this.comboBoxDiskType.SelectedItem, this.controlNewCover1.Image, this.DriveLetter, this, false);
         this.OnAdded();
     }
 }
Exemplo n.º 5
0
        public void Failed(string message)
        {
            this.textBoxProgressLog.Invoke(new AddTextHandler(this.AddText), "Adding files failed\r\n");

            //this.textBoxProgressLog.Text += "Adding files failed\r\n";
            this.donePage.FinishText = "Error occured while adding Disk \r\n"; // + ex.Message;
            this.Invoke(new AddedCDEvent(this.OnAdded));
            this.addedDisk = null;
        }
Exemplo n.º 6
0
 public void UpdateDisk(Disk disk, String name, DiskType type, Image image, Box box)
 {
     DBUtils.UpdateSQL(this.DBConString, "UPDATE [Disks] SET [DiskImage] = ?, [Name] = ?, [Type] = ?, [CDBox] = ?, [LastUpdate] = NOW() WHERE [id] = ?", new object[] {image.Id, name, type.Id, box.Id, disk.Id});
 }
Exemplo n.º 7
0
        public List<File> GetFiles(Disk disk)
        {
            using (OleDbDataReader myReader = DBUtils.ExecSQL(this.DBConString, "SELECT [id], [Name], [Size], [Date], [Attributes], [Parent], [Disk] FROM [Files] WHERE ([Disk] = ?) AND ([Parent] IS NULL) ORDER BY [Attributes] DESC, [Name] ASC", new object[] { disk.Id }))
            {
                List<File> lst = new List<File>();

                while (true == myReader.Read())
                {
                    string attr = myReader[4].ToString();
                    File f = new File(this, (int)(myReader[0]), (string)(myReader[1]), long.Parse(myReader[2].ToString()), DateTime.Parse(myReader[3].ToString()), int.Parse(attr));
                    lst.Add(f);
                }

                return lst;
            }
        }
Exemplo n.º 8
0
 public void DeleteDisk(Disk d)
 {
     DBUtils.ExecSQL(this.DBConString, "DELETE FROM [Disks] WHERE [id]= ?", new object[] {d.Id});
 }