Esempio n. 1
0
 private static void DoFetch(ConfLine conf)
 {
     if (!string.IsNullOrEmpty(conf.DistantPath))
     {
         var answ = (_dontWarnFetch || _silentUpdate) ? 0 : UserCommunication.Message("This will <b>replace your local</b> configuration with the distant one.<br><br>Do you wish to continue?", MessageImg.MsgInfo, "Fetch", "Confirmation", new List <string> {
             "Yes I do", "Yes don't ask again", "No, Cancel"
         }, true);
         if (answ == 0 || answ == 1)
         {
             if (answ == 1)
             {
                 _dontWarnFetch = true;
             }
             if (conf.IsDir)
             {
                 Utils.CopyDirectory(conf.DistantPath, conf.LocalPath);
             }
             else
             {
                 Utils.CopyFile(conf.DistantPath, conf.LocalPath);
                 if (conf.OnImport != null)
                 {
                     conf.OnImport(conf);
                 }
             }
         }
     }
 }
Esempio n. 2
0
        private static void DoDelete(ConfLine conf)
        {
            var answ = UserCommunication.Message("Do you really want to delete this file?", MessageImg.MsgQuestion, "Delete", "Confirmation", new List <string> {
                "Yes I do", "No, Cancel"
            }, true);

            if (answ == 0)
            {
                Utils.DeleteFile(conf.LocalPath);
                if (conf.OnImport != null)
                {
                    conf.OnImport(conf);
                }
            }
        }
Esempio n. 3
0
 private static void DoFetch(ConfLine conf)
 {
     if (!string.IsNullOrEmpty(conf.DistantPath)) {
         var answ = (_dontWarnFetch || _silentUpdate) ? 0 : UserCommunication.Message("This will <b>replace your local</b> configuration with the distant one.<br><br>Do you wish to continue?", MessageImg.MsgInfo, "Fetch", "Confirmation", new List<string> { "Yes I do", "Yes don't ask again", "No, Cancel" }, true);
         if (answ == 0 || answ == 1) {
             if (answ == 1)
                 _dontWarnFetch = true;
             if (conf.IsDir)
                 Utils.CopyDirectory(conf.DistantPath, conf.LocalPath);
             else {
                 Utils.CopyFile(conf.DistantPath, conf.LocalPath);
                 if (conf.OnImport != null)
                     conf.OnImport(conf);
             }
         }
     }
 }
Esempio n. 4
0
 private static void DoDelete(ConfLine conf)
 {
     var answ = UserCommunication.Message("Do you really want to delete this file?", MessageImg.MsgQuestion, "Delete", "Confirmation", new List<string> { "Yes I do", "No, Cancel" }, true);
     if (answ == 0) {
         Utils.DeleteFile(conf.LocalPath);
         if (conf.OnImport != null)
             conf.OnImport(conf);
     }
 }