예제 #1
0
        public static void BackupEnviroment()
        {
            string signature = DateTime.Now.Ticks.ToString();
            string tmpfolder = signature;
            string filename  = signature + ".back";
            string modfolder = hGestorModulo.ConfigTool.GetValor("RutaModulos");

            try {
                // creamos carpeta temporal
                WaitWin.SetText("Creando backup.....", 0);
                if (Directory.Exists(tmpfolder))
                {
                    Directory.Delete(tmpfolder, true);
                }
                Directory.CreateDirectory(tmpfolder);
                //copiamos contenido de la carpeta mudulos
                Util.CopyAll(new DirectoryInfo(modfolder),
                             new DirectoryInfo(tmpfolder));
                //copiamos el archivo de configuración
                Util.Copy(hGestorModulo.ConfigFile, Path.Combine(tmpfolder, hGestorModulo.ConfigFile), false);
                //comprimimos la carpeta temporal
                Util.AlertMessage(Tr.Catalog.GetString("Creado backup en ") + filename);
            } catch (Exception ex) {
                WaitWin.Hide();
                LogEx.CatchEx(ex);
            }
        }
예제 #2
0
 public static void CatchEx(Exception Ex, string Refer, object Sender)
 {
     try {
         if (horizonte.hGestorModulo.GtkEnabled)
         {
             WaitWin.SetText("Se ha producido un errro. Revise los datos y el registro", 1);
         }
         Console.WriteLine("** " + Refer + " **");
         Console.WriteLine(Ex);
     } catch (Exception ex) {
         Console.WriteLine(ex);
     }
 }