Exemplo n.º 1
0
        private void копироватьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int index = listView1.SelectedIndices[0];

            SelectFile = listView1.Items[index].Text;
            SelectFile = SelectFile.Substring(0, SelectFile.LastIndexOf('.'));

            RootDirRecord tempR = Emulator.FindRec(SelectFile);
            Inode         tempI = Emulator.FindInode(tempR.Number_Inode_Property);

            if (Emulator.CheckID(Emulator.CurrentUser, tempI) == true)
            {
                SavedRecord = Emulator.FindRec(SelectFile);

                SavedInode = Emulator.FindInode(SavedRecord.Number_Inode_Property);

                textdata = Emulator.ReadData(SelectFile);

                numofcopy = 1;

                вставитьToolStripMenuItem.Enabled = true;
            }
            else
            {
                MessageBox.Show("У вас недостаточно прав!");
            }
        }
Exemplo n.º 2
0
        private void свойстваToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int index = listView1.SelectedIndices[0];

            SelectFile = listView1.Items[index].Text;
            SelectFile = SelectFile.Substring(0, SelectFile.LastIndexOf('.'));
            RootDirRecord tempR = Emulator.FindRec(SelectFile);
            Inode         tempI = Emulator.FindInode(tempR.Number_Inode_Property);

            if (Emulator.CheckID(Emulator.CurrentUser, tempI) == true)
            {
                Change = true;
            }
            else
            {
                Change = false;
            }

            Prop P = new Prop();

            P.Owner = this;
            P.ShowDialog();

            удалитьToolStripMenuItem.Enabled    = false;
            копироватьToolStripMenuItem.Enabled = false;
            свойстваToolStripMenuItem.Enabled   = false;

            RefreshTreeList();
        }
Exemplo n.º 3
0
 private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (listView1.SelectedItems[0].ImageIndex == 0)
     {
         int index = listView1.SelectedIndices[0];
         SelectFile = listView1.Items[index].Text;
         RootDirRecord tempR = Emulator.FindRec(SelectFile);
         Inode         tempI = Emulator.FindInode(tempR.Number_Inode_Property);
         if (Emulator.CheckID(Emulator.CurrentUser, tempI) == true)
         {
             foreach (TreeNode node in treeView1.Nodes)
             {
                 if (node.Text == listView1.SelectedItems[0].Text)
                 {
                     treeView1.SelectedNode = node;
                     treeView1.Select();
                     break;
                 }
                 foreach (TreeNode innode in node.Nodes)
                 {
                     if (innode.Text == listView1.SelectedItems[0].Text)
                     {
                         treeView1.SelectedNode = innode;
                         treeView1.Select();
                         break;
                     }
                 }
             }
         }
         else
         {
             MessageBox.Show("У вас недостаточно прав!");
         }
     }
     else
     {
         int index = listView1.SelectedIndices[0];
         SelectFile = listView1.Items[index].Text;
         SelectFile = SelectFile.Substring(0, SelectFile.LastIndexOf('.'));
         RootDirRecord tempR = Emulator.FindRec(SelectFile);
         Inode         tempI = Emulator.FindInode(tempR.Number_Inode_Property);
         if (Emulator.CheckReadAccess(Emulator.CurrentUser, tempI) == true)
         {
             EditFile EF = new EditFile();
             EF.Owner = this;
             EF.ShowDialog();
             //удалитьToolStripMenuItem.Enabled = false;
             //копироватьToolStripMenuItem.Enabled = false;
             //свойстваToolStripMenuItem.Enabled = false;
         }
         else
         {
             MessageBox.Show("У вас недостаточно прав!");
         }
     }
 }
Exemplo n.º 4
0
        private void удалитьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int index = listView1.SelectedIndices[0];

            SelectFile = listView1.Items[index].Text;
            SelectFile = SelectFile.Substring(0, SelectFile.LastIndexOf('.'));

            RootDirRecord tempR = Emulator.FindRec(SelectFile);
            Inode         tempI = Emulator.FindInode(tempR.Number_Inode_Property);

            if (Emulator.CheckID(Emulator.CurrentUser, tempI) == true)
            {
                int[]    MainPosandNum = Emulator.FindBind(Emulator.CurrentPosition, SelectFile);
                int      Seek          = Emulator.FindRecSeek(SelectFile);
                UserInfo tempU         = Emulator.FindUser(tempI.User_ID_Property);
                Emulator.DeleteRIB(MainPosandNum[0], Seek, tempU, MainPosandNum[1], false);

                RefreshTreeList();
            }
            else
            {
                MessageBox.Show("У вас недостаточно прав!");
            }
            удалитьToolStripMenuItem.Enabled    = false;
            копироватьToolStripMenuItem.Enabled = false;
            свойстваToolStripMenuItem.Enabled   = false;


            RefreshTreeList();
            //this.Show();
            //Activate();
            //this.Activate();
            //this.OnActivated();
            //this.Activated;
            //this.Refresh();
        }