Esempio n. 1
0
        private void EventDeleteSettings(object sender, EventArgs e)
        {
            string FolderFullPath = TxOne.Text;

            TxTwo.Text = FolderFullPath;
            TxOne.Clear();
            ReturnCode code = DbSettings.DeleteAllSettingsOfOneFolder(FolderFullPath);

            Print(ReturnCodeFormatter.ToString(code));
        }
Esempio n. 2
0
        private void EventGetChildrenOfOneFolder(object sender, EventArgs e)
        {
            string        ParentFolderFullPath = TxOne.Text;
            List <string> list  = DbSettings.GetListOfFolders(ParentFolderFullPath);
            string        names = string.Empty;

            foreach (var item in list)
            {
                names += item + Environment.NewLine;
            }
            Print($"-------------------- {ParentFolderFullPath}");
            Print(names);
            TxTwo.Text = ParentFolderFullPath;
            TxOne.Clear();
        }
Esempio n. 3
0
        private void EventGetListOfSettings(object sender, EventArgs e)
        {
            string FolderFullPath = TxOne.Text;

            TxTwo.Text = FolderFullPath;
            TxOne.Clear();
            List <string> list  = DbSettings.GetSettings(FolderFullPath, TypeSetting.Text);
            string        names = string.Empty;

            foreach (var item in list)
            {
                names += item + Environment.NewLine;
            }
            Print($"SETTINGS OF A FOLDER = {FolderFullPath}");
            Print(names);
        }
Esempio n. 4
0
        private async void EventFolderForceDelete(object sender, EventArgs e)
        {
            string FolderFullPath = TxOne.Text;

            TxTwo.Text = FolderFullPath;
            TxOne.Clear();

            if (FolderFullPath.Trim().Length < 1)
            {
                Print("ERROR ! Folder name is empty");
                return;
            }

            Print("");
            Print("---------------------------------------------------------------------------------------------");
            BxFolderForceDelete.Enabled = false;
            BxForceDeleteFolderUsingTreeview.Enabled = false;

            Application.DoEvents();

            Stopwatch sw = new Stopwatch();

            await Task.Delay(500);

            Application.DoEvents();

            ReturnCode code = ReturnCodeFactory.Error("ERROR ! No any action was performed!");

            if ((sender as RadButton).Name == BxFolderForceDelete.Name)
            {
                Print(" * * *  FolderForceDelete");
                sw   = Stopwatch.StartNew();
                code = DbSettings.FolderForceDelete(FolderFullPath);
            }

            if ((sender as RadButton).Name == BxFolderForceDeleteAsync.Name)
            {
                Print(@" /\/\/\  FolderForceDeleteAsync");
                sw   = Stopwatch.StartNew();
                code = await DbSettings.FolderForceDeleteAsync(FolderFullPath);
            }

            if ((sender as RadButton).Name == BxForceDeleteFolderUsingTreeview.Name)
            {
                Print(" ^ ^ ^  FolderForceDeleteUsingTreeview");
                sw   = Stopwatch.StartNew();
                code = DbSettings.FolderForceDeleteUsingTreeview(FolderFullPath);
            }

            sw.Stop();

            BxFolderForceDelete.Enabled = true;
            BxForceDeleteFolderUsingTreeview.Enabled = true;

            Application.DoEvents();

            Print(ReturnCodeFormatter.ToString(code));
            Print($"Time = {sw.ElapsedMilliseconds} ms");

            await Task.Delay(500);

            code = DbSettings.FolderDelete(FolderFullPath, FolderFullPath);

            Print($"CHECK is folder deleted: {ReturnCodeFormatter.ToString(code)}");

            CxProcess.Execute(@"e:\restore_test_db.bat", "");
        }