Example #1
0
        internal void CreateNewDirectory(cFileSystemItem Item)
        {
            cFileFlags Flags = new cFileFlags();

            Flags.Directory = true;
            WorkingDirectory.AddItem(Item);
        }
Example #2
0
 private void UpdateDirectoryView()
 {
     ClearFileInfos();
     tbWorkDir.Text = FileSystem.GetPathToWorkingDirectoryString();
     ItemsInWorkingDirectory.Dispose();
     ItemsInWorkingDirectory        = new DataTable();
     dgItemsInWorkingDir.DataSource = ItemsInWorkingDirectory;
     ItemsInWorkingDirectory.Columns.Add("Name", typeof(string));
     dgItemsInWorkingDir.Columns["Name"].Width = 100;
     ItemsInWorkingDirectory.Columns.Add("Extention", typeof(string));
     dgItemsInWorkingDir.Columns["Extention"].Width = 55;
     ItemsInWorkingDirectory.Columns.Add("Flags", typeof(string));
     dgItemsInWorkingDir.Columns["Flags"].Width = 50;
     ItemsInWorkingDirectory.Columns.Add("Index", typeof(int));
     dgItemsInWorkingDir.Columns["Index"].Width = 50;
     for (int i = 0; i < FileSystem.GetNumItemsInWorkingDirectory(); i++)
     {
         DataRow         Temp = ItemsInWorkingDirectory.NewRow();
         cFileSystemItem Item = FileSystem.GetItemByIndex(i);
         Temp["Name"]      = Item.Metadata.GetName();
         Temp["Extention"] = Item.Metadata.GetExtention();
         Temp["Flags"]     = Item.Metadata.GetFlagsString();
         Temp["Index"]     = i;
         ItemsInWorkingDirectory.Rows.Add(Temp);
     }
 }
Example #3
0
        private void btChangeFile_Click(object sender, EventArgs e)
        {
            cFileSystemItem Temp = FileSystem.GetItemByIndex((int)dgItemsInWorkingDir.Rows[dgItemsInWorkingDir.SelectedRows[0].Index].Cells["Index"].Value);

            Temp.ReadFile(cbEndian.SelectedIndex);
            UpdateDiskUsage();
        }
Example #4
0
        internal cFileSystem(DiskType ModeOfDisk, cFloppy FloppyToUse)
        {
            FAT = new cFAT(ModeOfDisk, FloppyToUse);
            cFileFlags RootDirFlags = new cFileFlags();

            RootDirFlags.Directory = true;
            RootDirectory          = new cFileSystemItem("", "", RootDirFlags, true);
            WorkingDirectory       = RootDirectory;
            PathToWorkingDirectory = new List <cFileSystemItem>();
            PathToWorkingDirectory.Add(RootDirectory);
        }
Example #5
0
        private void btSaveName_Click(object sender, EventArgs e)
        {
            cFileSystemItem Temp = FileSystem.GetItemByIndex((int)dgItemsInWorkingDir.Rows[dgItemsInWorkingDir.SelectedRows[0].Index].Cells["Index"].Value);

            Temp.Metadata.SetName(tbFileName.Text);
            Temp.Metadata.SetExtension(tbExtention.Text);
            Temp.Metadata.Flags.Archive    = cbArchive.Checked;
            Temp.Metadata.Flags.Executable = cbExecutable.Checked;
            Temp.Metadata.Flags.Hidden     = cbHidden.Checked;
            Temp.Metadata.Flags.ReadOnly   = cbReadOnly.Checked;
            Temp.Metadata.Flags.SystemFile = cbSystemFile.Checked;
            UpdateDirectoryView();
        }
Example #6
0
 private void dgItemsInWorkingDir_SelectionChanged(object sender, EventArgs e)
 {
     if (dgItemsInWorkingDir.SelectedRows.Count > 0)
     {
         if (dgItemsInWorkingDir.SelectedRows[0].Index > -1)
         {
             cFileSystemItem Temp = FileSystem.GetItemByIndex((int)dgItemsInWorkingDir.Rows[dgItemsInWorkingDir.SelectedRows[0].Index].Cells["Index"].Value);
             tbFileName.Text        = Temp.Metadata.GetName();
             cbHidden.Checked       = Temp.Metadata.Flags.Hidden;
             cbReadOnly.Checked     = Temp.Metadata.Flags.ReadOnly;
             btChangeKernel.Visible = FileSystem.FAT.IsBootable();
             tbMediaName.Text       = FileSystem.GetMediaName();
             if (!Temp.IsDirectory())
             {
                 cbSystemFile.Checked = Temp.Metadata.Flags.SystemFile;
                 cbExecutable.Checked = Temp.Metadata.Flags.Executable;
                 cbArchive.Checked    = Temp.Metadata.Flags.Archive;
                 cbExecutable.Visible = true;
                 cbSystemFile.Visible = true;
                 cbArchive.Visible    = true;
                 btChangeFile.Visible = true;
                 lbDot.Visible        = true;
                 tbExtention.Visible  = true;
                 tbExtention.Text     = Temp.Metadata.GetExtention();
             }
             else
             {
                 cbSystemFile.Checked = false;
                 cbExecutable.Checked = false;
                 cbArchive.Checked    = false;
                 cbExecutable.Visible = false;
                 cbSystemFile.Visible = false;
                 cbArchive.Visible    = false;
                 btChangeFile.Visible = false;
                 lbDot.Visible        = false;
                 tbExtention.Visible  = false;
                 tbExtention.Text     = "";
             }
         }
         else
         {
             ClearFileInfos();
         }
         LastSelectedIndex = dgItemsInWorkingDir.SelectedRows[0].Index;
     }
 }