Esempio n. 1
0
 private static void ImportKeywords(ConfLine conf)
 {
     Keywords.Import();
     // Update autocompletion
     AutoComplete.RefreshStaticItems();
     ParserHandler.ParseCurrentDocument();
 }
Esempio n. 2
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. 3
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. 4
0
 private static void DoPush(ConfLine conf)
 {
     if (!string.IsNullOrEmpty(conf.LocalPath))
     {
         var answ = _dontWarnPush ? 0 : UserCommunication.Message("This will <b>replace the distant configuration <i>(for everyone!)</i></b> with your local configuration.<br><br>Do you wish to continue?", MessageImg.MsgWarning, "Push", "Confirmation", new List <string> {
             "Yes I do", "Yes don't ask again", "No, Cancel"
         }, true);
         if (answ == 0 || answ == 1)
         {
             if (answ == 1)
             {
                 _dontWarnPush = true;
             }
             if (conf.IsDir)
             {
                 Utils.CopyDirectory(conf.LocalPath, conf.DistantPath);
             }
             else
             {
                 Utils.CopyFile(conf.LocalPath, conf.DistantPath);
             }
         }
     }
 }
Esempio n. 5
0
 private static void ImportKeywords(ConfLine conf)
 {
     Keywords.Instance.Import();
     ParserHandler.ParseDocumentAsap();
 }
Esempio n. 6
0
 private static void ImportKeywords(ConfLine conf)
 {
     Keywords.Import();
     // Update autocompletion
     AutoComplete.RefreshStaticItems();
     ParserHandler.ParseCurrentDocument();
 }
Esempio n. 7
0
 private static void DoPush(ConfLine conf)
 {
     if (!string.IsNullOrEmpty(conf.LocalPath)) {
         var answ = _dontWarnPush ? 0 : UserCommunication.Message("This will <b>replace the distant configuration <i>(for everyone!)</i></b> with your local configuration.<br><br>Do you wish to continue?", MessageImg.MsgWarning, "Push", "Confirmation", new List<string> { "Yes I do", "Yes don't ask again", "No, Cancel" }, true);
         if (answ == 0 || answ == 1) {
             if (answ == 1)
                 _dontWarnPush = true;
             if (conf.IsDir)
                 Utils.CopyDirectory(conf.LocalPath, conf.DistantPath);
             else
                 Utils.CopyFile(conf.LocalPath, conf.DistantPath);
         }
     }
 }
Esempio n. 8
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. 9
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);
     }
 }