示例#1
0
        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);
        }
示例#2
0
        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();
        }