Пример #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();
 }
 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;
 }
Пример #8
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);
     }
 }
Пример #9
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();
 }
        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();
        }
Пример #11
0
 private void btnClose_Click(object sender, EventArgs e)
 {
     CommunSNCF.Log((int)CommunSNCF.logtype.Information, "Fermeture des conditions");
     this.Close();
     this.Dispose();
 }
Пример #12
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();
 }