Exemple #1
0
 public static void Save(RegistryKey Nkey)
 {
     try
     {
         string      chemin = Chemins.CheminConfiguration();
         RegistryKey valKey = Nkey.OpenSubKey(@chemin, true);
         if (valKey == null)
         {
             Nkey.CreateSubKey(@chemin, RegistryKeyPermissionCheck.Default, Utils.RegistrySecurity());
             valKey = Nkey.OpenSubKey(@chemin, true);
         }
         valKey.SetValue("langue", langue);
         valKey.SetValue("nom_template", template);
         valKey.SetValue("back_color_form", back_color_Form);
         valKey.SetValue("fore_color_label", fore_color_Label);
         valKey.SetValue("back_color_text", back_color_Text);
         valKey.SetValue("fore_color_text", fore_color_Text);
         valKey.SetValue("police_label", police_Label);
         valKey.SetValue("police_text", police_Text);
         valKey.SetValue("taille_label", taille_Label);
         valKey.SetValue("taille_text", taille_Text);
     }
     catch (Exception e)
     {
         Messages.Exception("Configuration (Save) ", e);
     }
     finally
     {
         Nkey.Close();
     }
 }
Exemple #2
0
        public static void Exception(string place, Exception ex)
        {
            string file = Chemins.CheminDatabase() + " server.txt";
            string msg  = DateTime.Now.ToString() + " ---- L'erreur suivante a été detectée : " + ex.Message + "----- Place : " + place;

            WriteTxt(file, msg);
        }
Exemple #3
0
 public static void Return(RegistryKey Nkey)
 {
     try
     {
         string      chemin = Chemins.CheminConfiguration();
         Object[]    lic    = new Object[3];
         RegistryKey valKey = Nkey.OpenSubKey(@chemin, false);
         if (valKey != null)
         {
             langue           = (string)(valKey.GetValue("langue") != null ? valKey.GetValue("langue") : Constantes.LANGUE_FRANCAIS);
             template         = (string)(valKey.GetValue("nom_template") != null ? valKey.GetValue("nom_template") : "Basique");
             back_color_Form  = (string)(valKey.GetValue("back_color_form") != null ? valKey.GetValue("back_color_form") : "GradientInactiveCaption");
             fore_color_Label = (string)(valKey.GetValue("fore_color_label") != null ? valKey.GetValue("fore_color_label") : "ControlText");
             back_color_Text  = (string)(valKey.GetValue("back_color_text") != null ? valKey.GetValue("back_color_text") : "Control");
             fore_color_Text  = (string)(valKey.GetValue("fore_color_text") != null ? valKey.GetValue("fore_color_text") : "WindowText");
             police_Label     = (string)(valKey.GetValue("police_label") != null ? valKey.GetValue("police_label") : "Microsoft Sans Serif");
             police_Text      = (string)(valKey.GetValue("police_text") != null ? valKey.GetValue("police_text") : "Microsoft Sans Serif");
             taille_Label     = float.Parse((string)(valKey.GetValue("taille_label") != null ? valKey.GetValue("taille_label") : "8,25"));
             taille_Text      = float.Parse((string)(valKey.GetValue("taille_text") != null ? valKey.GetValue("taille_text") : "8,25"));
         }
         else
         {
             langue           = (string)(Constantes.LANGUE_FRANCAIS);
             template         = (string)("Basique");
             back_color_Form  = (string)("GradientInactiveCaption");
             fore_color_Label = (string)("ControlText");
             back_color_Text  = (string)("Control");
             fore_color_Text  = (string)("WindowText");
             police_Label     = (string)("Microsoft Sans Serif");
             police_Text      = (string)("Microsoft Sans Serif");
             taille_Label     = float.Parse((string)("8,25"));
             taille_Text      = float.Parse((string)("8,25"));
             Save();
         }
     }
     catch (Exception e)
     {
         Messages.Exception("Configuration (Return) ", e);
     }
     finally
     {
         Nkey.Close();
     }
 }