public bool Start() { var path = ConfigurationService.GetDarklandsPath(ConfigType.DarklandsCompanion); if (StaticDataService.SetDarklandsPath(path)) { LiveDataService.ConnectionMonitor += OnConnected; LiveDataService.Connect(); return(true); } MessageVm.Messages = "Error: Cannot find Darklands from the folder '" + path + "'"; return(false); }
private static void StartLiveDataService(Action callback) { LiveDataService.ConnectionMonitor += connected => { if (connected) { Console.WriteLine("Darklands process found."); callback(); } else { Console.WriteLine("Searching for Darklands process..."); } }; LiveDataService.Connect(); }