Пример #1
0
        public string SetKeyWordsInRegistry()
        {
            CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Sauvegarde de mots clés des conditions");
            string result = CommunSNCF.ReadRegParam("ConditionsKeyWords");

            string[] allSubKeyKeyWords = CommunSNCF.ReadRegAllSubkeys(CommunSNCF.HKLMApplication.Replace("HKEY_CURRENT_USER\\", "") + "\\Conditions_KeyWords");
            foreach (string keyword in allSubKeyKeyWords)
            {
                string lKeyWords = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication + "\\Conditions_KeyWords", keyword);
                foreach (string word in lKeyWords.Split(','))
                {
                    if (!result.Contains(word))
                    {
                        if (result == "")
                        {
                            result = word;
                        }
                        else
                        {
                            result += "," + word;
                        }
                    }
                }
            }
            return(result);
        }
Пример #2
0
        private void FormAbout_Load(object sender, EventArgs e)
        {
            CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Affichage de la boite a propos");
            var productInfo = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);

            label1.Text = "Version : " + productInfo.FileVersion + " - " + productInfo.LegalCopyright;
        }
 private void btnCancel_Click(object sender, EventArgs e)
 {
     CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Annulation des informations et de l'aperçu du script");
     CommunSNCF.pbInformation = null;
     CommunSNCF.pbAvancement  = -1;
     this.Close();
 }
Пример #4
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Enregistrement des conditions");
     try
     {
         if (CommunSNCF.IsNewCondition)
         {
             string HKCUConditions = CommunSNCF.HKLMApplication + @"\Conditions\";
             CommunSNCF.SaveRegParam(HKCUConditions, txtConditionName.Text, String.Join("|", txtCondition.Lines));
             string HKCUConditionsKeyWords = CommunSNCF.HKLMApplication + @"\Conditions_KeyWords\";
             CommunSNCF.SaveRegParam(HKCUConditionsKeyWords, txtConditionName.Text, txtKeyWords.Text);
             SetKeyWordsInRegistry();
             FormMain fm = new FormMain();
             fm.InsertConditionsInMenu(true);
         }
         else
         {
             string HKCUConditions = CommunSNCF.HKLMApplication + @"\Conditions\";
             CommunSNCF.SaveRegParam(HKCUConditions, cboConditions.Text, String.Join("|", txtCondition.Lines));
             string HKCUConditionsKeyWords = CommunSNCF.HKLMApplication + @"\Conditions_KeyWords\";
             CommunSNCF.SaveRegParam(HKCUConditionsKeyWords, cboConditions.Text, txtKeyWords.Text);
             SetKeyWordsInRegistry();
         }
     } catch (Exception ex)
     {
         CommunSNCF.Log((int)CommunSNCF.logtype.Error, "Enregistrement des conditions " + ex.Message);
     }
     finally
     {
         this.Close();
     }
 }
 private void FormAddEditMethode_Load(object sender, EventArgs e)
 {
     CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Ouverture de l'éditeur de méthode");
     if (File.Exists(CommunSNCF.methodeFile))
     {
         txtMethode.Text = File.ReadAllText(CommunSNCF.methodeFile, Encoding.UTF8);
     }
 }
 private void btnCancel_Click(object sender, EventArgs e)
 {
     CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Annulation de l'ajout ou modification de méthodes");
     fm = new FormMain();
     fm.TSMIRefreshMethodesList_Click(sender, e);
     this.Close();
     this.Dispose();
 }
Пример #7
0
 private void FormOptions_Load(object sender, EventArgs e)
 {
     txtKeywordsHighlight.Text = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "KeyWordsHighLight");
     txtPathMethode.Text       = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "PathMethodes");
     txtSeparatorKeywords.Text = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "KeyWordsSeparator");
     txtTemplateFile.Text      = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "Template");
     txtVBKeyWords.Text        = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "KeyWordsVB");
     txtWSFkeyWords.Text       = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "KeyWordsWSFScript");
     txtCmdLineForMDT.Text     = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "CmdLineForMDT");
 }
 private void frmInformation_Load(object sender, EventArgs e)
 {
     CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Ajout d'information au script");
     lblDescr.Text = lblDescr.Text.Replace("xxx", CommunSNCF.pbMethode);
     if (CommunSNCF.pbAvancement >= 100)
     {
         CommunSNCF.pbAvancement = CommunSNCF.pbAvancement - 100;
     }
     nAvancement.Value += CommunSNCF.pbAvancement;
 }
Пример #9
0
 private void FormNews_Load(object sender, EventArgs e)
 {
     CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Affichage des nouveautés");
     try
     {
         if (File.Exists(Path.Combine(Application.StartupPath, "changelog.txt")))
         {
             txtChangeLog.Text = File.ReadAllText(Path.Combine(Application.StartupPath, "changelog.txt"), Encoding.UTF8);
         }
     } catch (Exception ex)
     {
         CommunSNCF.Log((int)CommunSNCF.logtype.Error, "Problème d'ouverture des nouveautés " + ex.Message);
     }
 }
Пример #10
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Annulation de l'aperçu");
     if (File.Exists(CommunSNCF.scriptFile))
     {
         FileInfo fi   = new FileInfo(CommunSNCF.scriptFile);
         string   path = fi.DirectoryName;
         Directory.Delete(path, true);
     }
     CommunSNCF.scriptFile       = "";
     CommunSNCF.finalDestination = "";
     fm.DeletetempContent();
     FormMain.isNewFile = true;
     this.Close();
     this.Dispose();
 }
Пример #11
0
 private void cboConditions_SelectedValueChanged(object sender, EventArgs e)
 {
     if (cboConditions.SelectedItem.ToString() != "")
     {
         txtKeyWords.Text = "";
         string content = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication + "\\Conditions", cboConditions.SelectedItem.ToString());
         txtCondition.Lines = content.Split('|');
         string keywords = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication + "\\Conditions_KeyWords", cboConditions.SelectedItem.ToString());
         txtKeyWords.Text = keywords;
     }
     else
     {
         btnSave.Enabled   = false;
         txtCondition.Text = "";
         txtKeyWords.Text  = "";
     }
 }
Пример #12
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            FormMain fm = new FormMain();

            CommunSNCF.SaveRegParam("KeyWordsHighLight", txtKeywordsHighlight.Text);
            CommunSNCF.SaveRegParam("PathMethodes", txtPathMethode.Text);
            CommunSNCF.SaveRegParam("KeyWordsSeparator", txtSeparatorKeywords.Text);
            CommunSNCF.SaveRegParam("Template", txtTemplateFile.Text);
            CommunSNCF.SaveRegParam("KeyWordsVB", txtVBKeyWords.Text);
            CommunSNCF.SaveRegParam("KeyWordsWSFScript", txtWSFkeyWords.Text);
            CommunSNCF.SaveRegParam("CmdLineForMDT", txtCmdLineForMDT.Text);
            FormMain.regPathMethodes = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "PathMethodes");
            FormMain.regTemplate     = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "Template");
            FormMain.regKWScript     = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "KeyWordsWSFScript");
            FormMain.regKWVB         = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "KeyWordsVB");
            FormMain.regKWSeparator  = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "KeyWordsSeparator");
            FormMain.regKWHigh       = CommunSNCF.ReadRegParam(CommunSNCF.HKLMApplication, "KeyWordsHighLight");
            this.Close();
            this.Dispose();
        }
Пример #13
0
 private void FormCondition_Load(object sender, EventArgs e)
 {
     if (CommunSNCF.IsNewCondition)
     {
         pnlEditCondition.Visible = false;
         pnlNewCondition.Visible  = true;
         btnSave.Enabled          = false;
         txtKeyWords.Text         = "ex. If (,Then,Else,End If";
     }
     else
     {
         List <string> lConditions = CommunSNCF.ReadRegAllSubkeys();
         lConditions.Add("");
         lConditions.Sort();
         string[] Conditions = lConditions.ToArray();
         cboConditions.DataSource = Conditions;
         pnlEditCondition.Visible = true;
         pnlNewCondition.Visible  = false;
         btnSave.Enabled          = false;
         txtKeyWords.Text         = "";
     }
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Enregistrement de la méthode");
            FileInfo fi = new FileInfo(CommunSNCF.methodeFile);

            if (File.Exists(Path.Combine(this.fm.GetPathMethodes, fi.Name)))
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine(txtMethode.Text);
                File.WriteAllText(CommunSNCF.methodeFile, sb.ToString(), Encoding.UTF8);
                File.Copy(CommunSNCF.methodeFile, Path.Combine(this.fm.GetPathMethodes, fi.Name), true);
            }
            else
            {
                //Déplacer le fichier de tmp dans méthode
                File.Move(CommunSNCF.methodeFile, Path.Combine(this.fm.GetPathMethodes, fi.Name));
                //this.fm.ListBoxMethodes.Items.Add(fi.Name);
            }
            //CommunSNCF.FillListBoxFromDirectory(this.fm.ListBoxMethodes, this.fm.GetPathMethodes);
            fm.TSMIRefreshMethodesList_Click(sender, e);
            this.Close();
            this.Dispose();
        }
Пример #15
0
 private void btnClose_Click(object sender, EventArgs e)
 {
     CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Fermeture des conditions");
     this.Close();
     this.Dispose();
 }
Пример #16
0
 private void btnCancel_Click_1(object sender, EventArgs e)
 {
     CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Annulation des informations et de l'aperçu du script");
     this.Close();
     this.Dispose();
 }