private async void RemoteSystemWatcher_RemoteSystemAdded(RemoteSystemWatcher sender, RemoteSystemAddedEventArgs args)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         _progressRing.IsActive = true;
         RemoteSystems.Add(args.RemoteSystem);
         DeviceMap.Add(args.RemoteSystem.Id, args.RemoteSystem);
     });
 }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AppiumConfig"/> class.
        /// Configuration method for wiring up the information needed for the appium drivers and application
        /// </summary>
        /// <param name="deviceName">Name of the device</param>
        public AppiumConfig(string deviceName = null)
        {
            operatingSystem = Environment.OSVersion;
            platform        = operatingSystem.Platform;

            buildDir    = AppDomain.CurrentDomain.BaseDirectory;
            solutionDir = Directory.GetParent(buildDir).Parent.Parent.Parent.FullName;

            DeviceMap = GetMap.Get(devicesDir, deviceName).Map;
            appPath   = SetAppPath.Get(DeviceMap).AppPath;

            DeviceMap.Add("app", appPath);
        }
 private async void RemoteSystemWatcher_RemoteSystemUpdated(RemoteSystemWatcher sender, RemoteSystemUpdatedEventArgs args)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         _progressRing.IsActive = true;
         if (DeviceMap.ContainsKey(args.RemoteSystem.Id))
         {
             RemoteSystems.Remove(DeviceMap[args.RemoteSystem.Id]);
             DeviceMap.Remove(args.RemoteSystem.Id);
         }
         RemoteSystems.Add(args.RemoteSystem);
         DeviceMap.Add(args.RemoteSystem.Id, args.RemoteSystem);
         UpdateList();
     });
 }
Пример #4
0
        private void UpdateDevices(object obj)
        {
            Tuple <IMiningDeviceManager, IMiningDevice> t = obj as Tuple <IMiningDeviceManager, IMiningDevice>;

            var arg1 = t.Item1;
            var arg2 = t.Item2;

            if (arg1 != null && arg1.Devices != null)
            {
                if (Devices.Count != arg1.Devices.Count() - 1)
                {
                    foreach (IMiningDevice d in arg1.Devices)
                    {
                        if (!DeviceMap.ContainsKey(d))
                        {
                            MiningDeviceData data = new MiningDeviceData(d);

                            Devices.Add(data);

                            DeviceMap.Add(d, data);
                        }
                    }
                }
                else if (arg2 != null)
                {
                    if (!DeviceMap.ContainsKey(arg2))
                    {
                        MiningDeviceData data = new MiningDeviceData(arg2);

                        Devices.Add(data);

                        DeviceMap.Add(arg2, data);
                    }
                }
            }
        }