Ejemplo n.º 1
0
        public static Сustomization GetSettings()
        {
            string        filename = "custom.dat";
            Сustomization custom   = new Сustomization();

            if (File.Exists(filename))
            {
                Stream          fstream   = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.None);
                BinaryFormatter binFormat = new BinaryFormatter();
                custom = (Сustomization)binFormat.Deserialize(fstream);
                fstream.Close();
            }
            return(custom);
        }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();
            custom = Сustomization.GetSettings();
            GiveSetting();
            Login(havePas);
            this.WindowState = FormWindowState.Maximized;
            TakeDisk();
            webClients        = new List <WebClient>();
            WindowState       = FormWindowState.Normal;
            listView1.Sorting = System.Windows.Forms.SortOrder.None; //Ascending Descending

            // правая кнопка мыши по файлу/папке
            #region right click
            ToolStripMenuItem createDirMenuItem   = new ToolStripMenuItem("Создать папку");
            ToolStripMenuItem renameMenuItem      = new ToolStripMenuItem("Переименовать");
            ToolStripMenuItem deleteMenuItem      = new ToolStripMenuItem("Удалить");
            ToolStripMenuItem archiveMenuItem     = new ToolStripMenuItem("Архивировать");
            ToolStripMenuItem antiArchiveMenuItem = new ToolStripMenuItem("Разархивировать");
            ToolStripMenuItem moveFromMenuItem    = new ToolStripMenuItem("Переместить что");
            ToolStripMenuItem moveMenuItem        = new ToolStripMenuItem("Переместить куда");
            ToolStripMenuItem copyMenuItem        = new ToolStripMenuItem("Скопировать");
            ToolStripMenuItem pasteMenuItem       = new ToolStripMenuItem("Вставить");
            ToolStripMenuItem openMenuItem        = new ToolStripMenuItem("Открыть");
            ToolStripMenuItem searchRegex         = new ToolStripMenuItem("Поиск по регулярному выражению");
            ToolStripMenuItem downoloadFile       = new ToolStripMenuItem("Скачать файл сюда");
            ToolStripMenuItem canselDownoload     = new ToolStripMenuItem("Отмениит скачивание файла");

            contextMenuStrip1.Items.AddRange(new[] { createDirMenuItem, renameMenuItem, deleteMenuItem, archiveMenuItem, antiArchiveMenuItem, moveFromMenuItem, moveMenuItem, copyMenuItem, pasteMenuItem, openMenuItem, searchRegex, downoloadFile, canselDownoload });
            treeView1.ContextMenuStrip = contextMenuStrip1;
            createDirMenuItem.Click   += createDirMenuItem_Click;
            renameMenuItem.Click      += renameMenuItem_Click;
            deleteMenuItem.Click      += deleteMenuItem_Click;
            archiveMenuItem.Click     += archiveMenuItem_Click;
            antiArchiveMenuItem.Click += antiArchiveMenuItem_Click;
            moveFromMenuItem.Click    += moveFromMenuItem_Click;
            moveMenuItem.Click        += moveMenuItem_Click;
            copyMenuItem.Click        += copyMenuItem_Click;
            pasteMenuItem.Click       += pasteMenuItem_Click;
            openMenuItem.Click        += openMenuItem_Click;
            searchRegex.Click         += searchRegex_Click;
            downoloadFile.Click       += downoloadFile_Click;
            canselDownoload.Click     += canselDownoload_Click;
            #endregion
        }