Ejemplo n.º 1
0
 public ConfigForm(MainForm f)
 {
     InitializeComponent();
     //chargement des paramètres
     this.folders = Serialization.deserializeXML("folders.xml");
     this.files = new ArrayList();
     ImageList imgList = new ImageList();
     this.treeview.ImageList = imgList;
     this.treeViewFichiers.ImageList = imgList;
     imgList.Images.Add(System.Drawing.Image.FromFile(Environment.CurrentDirectory + @"/images/dossier_windows.png"));
     imgList.Images.Add(System.Drawing.Image.FromFile(Environment.CurrentDirectory + @"/images/fichier.jpg"));
     this.NUDInterval.Value = Convert.ToDecimal(ConfigurationManager.AppSettings["period"]);
     this.tbHour.Text = ConfigurationManager.AppSettings["heure"];
     this.tbMinutes.Text = ConfigurationManager.AppSettings["minute"];
     this.tbPath.Text = ConfigurationManager.AppSettings["path"];
     this.tbMDP.Text = ConfigurationManager.AppSettings["password"];
     Security sec = new Security();
     this.tbMDPAdmin.Text = sec.caesarToString(ConfigurationManager.AppSettings["passwordAdmin"],15);
     this.numericUpDown1.Value = Convert.ToDecimal(ConfigurationManager.AppSettings["nbSaves"]);
     this.tbFrom.Text = ConfigurationManager.AppSettings["from"];
     this.tbMDPFrom.Text = ConfigurationManager.AppSettings["MDPfrom"];
     this.tbSMTP.Text = ConfigurationManager.AppSettings["SMTP"];
     this.tbPort.Text = ConfigurationManager.AppSettings["port"];
     this.tbTo.Text = ConfigurationManager.AppSettings["to"];
     if (ConfigurationManager.AppSettings["SSL"] == "1")
     { this.cbSSL.Checked = true; }
     this.ancienInterval = this.NUDInterval.Value.ToString();
     this.toolTip1.ToolTipIcon = ToolTipIcon.Warning;
     this.form = f;
     this.populatetreeView();
     this.form.configFormThread.Abort();
 }
Ejemplo n.º 2
0
 public SaveViewer(Save save, MainForm mf)
 {
     InitializeComponent();
     this.nb = 0;
     this.s = save;
     save.setBgwk(this.backgroundWorker);
     this.backgroundWorker.RunWorkerAsync(s.getInfosCopie());
     this.lbAvancementSauvegarde.Text = "0";
     this.mainform = mf;
 }
Ejemplo n.º 3
0
 public Save(MainForm mf)
 {
     this.c = new Configuration();
     frm = mf;
     nextSave = initNextSave();
     this.infosCopie = new string[2];
     this.saveRoot = this.getSaveRoot();
     nextSave = initNextSave();
     tempsRestant = nextSave - DateTime.Now;
     if (nextSave.CompareTo(DateTime.Now) < 0)
     {
         reportDateSauvegarde();
     }
 }
Ejemplo n.º 4
0
 public ReportSaveForm(MainForm mf, Save s)
 {
     InitializeComponent();
     //Construction de la liste déroulante
     this.label2.Text = "Le redémarrage de l'ordinateur est necessaire. Voulez-vous reporter la Sauvegarde ?";
     this.comboBox1.Items.Add("redémarrer maintenant");
     this.comboBox1.Items.Add("10 minutes");
     this.comboBox1.Items.Add("15 minutes");
     this.comboBox1.Items.Add("30 minutes");
     this.comboBox1.Items.Add("1 heure");
     this.comboBox1.Items.Add("2 heures");
     this.comboBox1.SelectedIndex = 0;
     this.m = mf;
     this.nxts = s.GetNextSave();
     this.lbCAR.Text = "30";
     this.i = 1;
     this.timer1.Start();
 }
Ejemplo n.º 5
0
        static void Main()
        {
            Thread.Sleep(1000);
            bool owned;
            Mutex m = new Mutex(true, Application.ProductName, out owned);
            if (owned)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                    MainForm mf = new MainForm();
                    if (mf.launch)
                    { Application.Run(mf); }
                else
                    { Application.Exit(); }
                    m.ReleaseMutex();
            }
            else
            {
                MessageBox.Show("L'application est déja lancée", Application.ProductName);
            }
        }