static void initalize() { ConfigObjects.loadAllConfig(); // 注册C++的消息回调函数 LogCallBack callBack = new LogCallBack(Log.info); // regLogCallBack(callBack); }
// 点击取消 private void Cancel_Click(object sender, EventArgs e) { // 恢复原样 ConfigObjects.loadDirectories(); TableConverter.refreshTableTree(); instance.Hide(); }
// 点击OK private void OK_Click(object sender, EventArgs e) { // 保存设置 ConfigObjects.saveDirectories(); TableConverter.refreshTableTree(); instance.Hide(); }
public void DownloadAndTransformConfigFiles(string strfile, string environment, out string apiresponse) { apiresponse = string.Empty; try { ConfigObjects configObjects = JsonConvert.DeserializeObject <ConfigObjects>(File.ReadAllText(strfile)); foreach (var configObject in configObjects.GitConfigObjects) { //1. Download Config Files Console.WriteLine(string.Format("downloading files {0} and {1}", configObject.sourceconfig, configObject.transformconfig)); Helper.DownLoadConfigFile(configObject, out apiresponse); //2. Transform Config Files Console.WriteLine(string.Format("transforming {0} for {1}", configObject.sourceconfig, configObject.octopusprojectname)); TransformFile(configObject.octopusprojectname, configObject.octopusprojectname, environment, (TransformType)Enum.Parse(typeof(TransformType), configObject.configtype)); //3. Compare files Console.WriteLine(string.Format("comparing files {0} and {1}", configObject.sourceconfig, configObject.compareconfig)); configObject.compareconfig.CompareFiles(configObject.octopusprojectname + "/" + configObject.sourceconfig, "diff-" + configObject.compareconfig, (TransformType)Enum.Parse(typeof(TransformType), configObject.configtype)); } } catch (Exception e) { apiresponse = e.Message; } }
private static void Main() { AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; WindowsSessionManager.Register(); SetupWinForms(); Cef.EnableHighDPISupport(); var reporter = new Reporter(); Config = new ConfigObjects <UserConfig, SystemConfig>( new UserConfig(), new SystemConfig(), new PluginConfig(new string[] { "official/clear-columns", "official/reply-account" }) ); try { Lib.AppLauncher launch = Lib.Initialize(new AppBuilder { Setup = new Setup(), ErrorHandler = reporter, SystemHandler = new SystemHandler(), MessageDialogs = new MessageDialogs(), FileDialogs = new FileDialogs() }); errorReporter = reporter; launch(); } catch (AppException e) { FormMessage.Error(e.Title, e.Message, FormMessage.OK); } }
public void DownloadConfigFiles(string strfile, out string apiresponse) { apiresponse = string.Empty; try { ConfigObjects configObjects = JsonConvert.DeserializeObject <ConfigObjects>(File.ReadAllText(strfile)); //1. Download Config Files foreach (var configObject in configObjects.GitConfigObjects) { Helper.DownLoadConfigFile(configObject, out apiresponse); } } catch (Exception e) { apiresponse = e.Message; } }