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