示例#1
0
 /// <summary>
 /// Backup
 /// </summary>
 private void ToolStripMenuItemBackup_Click(object sender, EventArgs e)
 {
     if (DialogResult.OK == saveFileDialogBackup.ShowDialog())
     {
         FormWorkerThreadTask.Execute(new Pic.DAL.TPTBackup(saveFileDialogBackup.FileName));
     }
 }
示例#2
0
        private void bnUpdateLocalisationFile_Click(object sender, EventArgs e)
        {
            try
            {
                // process all components and collect parameter descriptions
                FormWorkerThreadTask.Execute(new TPTCollectPluginParameterNames());

                // open localisation file
                ProcessStartInfo startInfo = new ProcessStartInfo();
                startInfo.UseShellExecute = true;
                startInfo.Verb            = "Open";
                startInfo.CreateNoWindow  = false;
                startInfo.WindowStyle     = ProcessWindowStyle.Normal;
                startInfo.FileName        = LocalizerImpl.Instance.LocalisationFileName;
                using (Process p = new Process())
                {
                    p.StartInfo = startInfo;
                    p.Start();
                }
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
            }
        }
示例#3
0
 /// <summary>
 /// Merge
 /// </summary>
 private void OnMerge(object sender, EventArgs e)
 {
     if (DialogResult.OK == openFileDialogRestore.ShowDialog())
     {
         FormWorkerThreadTask.Execute(new Pic.DAL.TPTMerge(openFileDialogRestore.FileName));
         // refresh tree
         treeView.RefreshTree();
         // back to default cursor
         Cursor.Current = Cursors.Default;
     }
 }
示例#4
0
        /// <summary>
        /// Merge
        /// </summary>
        private void ToolStripMenuItemMerge_Click(object sender, EventArgs e)
        {
            if (DialogResult.OK == openFileDialogRestore.ShowDialog())
            {
                FormWorkerThreadTask.Execute(new Pic.DAL.TPTMerge(openFileDialogRestore.FileName));

                /*
                 * // refresh tree
                 * _treeViewCtrl.RefreshTree();
                 */
                // back to default cursor
                Cursor.Current = Cursors.Default;
            }
        }
示例#5
0
 /// <summary>
 /// Clear
 /// </summary>
 private void OnClearDatabase(object sender, EventArgs e)
 {
     try
     {
         // form
         if (DialogResult.Yes == MessageBox.Show(Resources.ID_CLEARDATABASEWARNING,
                                                 ProductName,
                                                 MessageBoxButtons.YesNo))
         {   // answered 'Yes'
             // start thread
             FormWorkerThreadTask.Execute(new Pic.DAL.TPTClearDatabase());
             // refresh tree
             treeView.RefreshTree();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(string.Format(ex.Message));
     }
 }
示例#6
0
 /// <summary>
 /// Restore
 /// </summary>
 private void OnRestore(object sender, EventArgs e)
 {
     // warning
     if (MessageBox.Show(Resources.ID_RESTOREWARNING
                         , ProductName
                         , MessageBoxButtons.OKCancel
                         , MessageBoxIcon.Warning
                         ) == DialogResult.Cancel)
     {
         return;
     }
     if (DialogResult.OK == openFileDialogRestore.ShowDialog())
     {
         FormWorkerThreadTask.Execute(new Pic.DAL.TPTRestore(openFileDialogRestore.FileName));
         // refresh tree
         treeView.RefreshTree();
         // expand all so that modifications can be visualized
         if (treeView.Nodes.Count > 0)
         {
             treeView.Nodes[0].ExpandAll();
         }
     }
 }
示例#7
0
        /// <summary>
        /// Restore
        /// </summary>
        private void ToolStripMenuItemRestore_Click(object sender, EventArgs e)
        {
            // warning
            if (MessageBox.Show(PicParam.Properties.Resources.ID_RESTOREWARNING
                                , ProductName
                                , MessageBoxButtons.OKCancel
                                , MessageBoxIcon.Warning
                                ) == DialogResult.Cancel)
            {
                return;
            }
            if (DialogResult.OK == openFileDialogRestore.ShowDialog())
            {
                FormWorkerThreadTask.Execute(new Pic.DAL.TPTRestore(openFileDialogRestore.FileName));

                /*
                 * // refresh tree
                 * _treeViewCtrl.RefreshTree();
                 * // expand all so that modifications can be visualized
                 * if (_treeViewCtrl.Nodes.Count > 0)
                 *  _treeViewCtrl.Nodes[0].ExpandAll();
                 */
            }
        }
 /// <summary>
 /// Use this method to process any task
 /// </summary>
 public static void Execute(TreeProcessingTask task)
 {
     FormWorkerThreadTask form = new FormWorkerThreadTask(task);
     form.ShowDialog();
 }
示例#9
0
        /// <summary>
        /// Use this method to process any task
        /// </summary>
        public static void Execute(TreeProcessingTask task)
        {
            FormWorkerThreadTask form = new FormWorkerThreadTask(task);

            form.ShowDialog();
        }