Ejemplo n.º 1
0
        void Adapter_DeviceConnected(object sender, DeviceConnectionEventArgs e)
        {
            Debug.WriteLine("Device Connected");

            this.Device = e.Device;

            //if (this.Device.Name.Replace("PE", "").Replace("FT", "").StartsWith("932"))
            //{
            //	Debug.WriteLine("Instantiating PE932 Handler");
            //	this.syncDeviceHandler = SyncDeviceHandler932.GetInstance();
            //}
            /*else */
            if (this.Device.Name.Replace("PE", "").Replace("FT", "").StartsWith("961"))
            {
                Debug.WriteLine("Instantiating PE/FT961 Handler");
                this.SyncDeviceHandler = SyncDeviceHandler961.GetInstance();
            }
            else if (this.Device.Name.StartsWith("H25FE2"))
            {
                this.SyncDeviceHandler = SyncDeviceHandlerStriiv.GetInstance();
            }

            this.SyncDeviceHandler.IncrementProgressBar += UpdateProgressBar;
            this.SyncDeviceHandler.SyncDone             += DoneSyncing;

            this.SyncDeviceHandler.SetAdapter(this.Adapter);
            this.SyncDeviceHandler.SetDevice(this.Device);
            this.SyncDeviceHandler.SetWebService(this.WebService);

            e.Device.ServicesDiscovered += Services_Discovered;
            //this.Adapter.CommandResponse += SyncDeviceHandler.ReceiveResponse;
            e.Device.DiscoverServices();
        }
		public static SyncDeviceHandlerStriiv GetInstance()
		{
			if (Instance == null)
			{
				lock (_synclock)
				{
					if (Instance == null)
					{
						Instance = new SyncDeviceHandlerStriiv();
					}
				}
			}

			return Instance;
		}
Ejemplo n.º 3
0
        public static SyncDeviceHandlerStriiv GetInstance()
        {
            if (Instance == null)
            {
                lock (_synclock)
                {
                    if (Instance == null)
                    {
                        Instance = new SyncDeviceHandlerStriiv();
                    }
                }
            }

            return(Instance);
        }