Ejemplo n.º 1
0
 private static void ImportKeywords(ConfLine conf)
 {
     Keywords.Import();
     // Update autocompletion
     AutoComplete.RefreshStaticItems();
     ParserHandler.ParseCurrentDocument();
 }
Ejemplo 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);
                 }
             }
         }
     }
 }
Ejemplo 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);
                }
            }
        }
Ejemplo 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);
             }
         }
     }
 }
Ejemplo n.º 5
0
 private static void ImportKeywords(ConfLine conf)
 {
     Keywords.Instance.Import();
     ParserHandler.ParseDocumentAsap();
 }
Ejemplo n.º 6
0
 private static void ImportKeywords(ConfLine conf)
 {
     Keywords.Import();
     // Update autocompletion
     AutoComplete.RefreshStaticItems();
     ParserHandler.ParseCurrentDocument();
 }
Ejemplo 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);
         }
     }
 }
Ejemplo 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);
             }
         }
     }
 }
Ejemplo 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);
     }
 }