private void restoreDevice()
 {
     if (mDeviceFinder != null && mDeviceId != null && mPickerListener != null)
     {
         SmcDevice d = mDeviceFinder.getDevice(mType, mDeviceId);
         if (d != null)
         {
             mPickerListener.onDeviceSelected(d);
             Active = true;
         }
     }
 }
 public override void onDeviceRemoved(SmcDeviceFinder deviceFinder, SmcDevice smcDevice, int error)
 {
     // We aren't interested in individual devices, only in their number
     updateButtonCounter();
     //if current device has been removed
     if (smcDevice.Id.Equals(mDeviceId))
     {
         Active = false;
         if (mPickerListener != null)
         {
             mPickerListener.onAllShareDisabled();
         }
     }
 }
        /// <summary>
        /// Callback when user has selected device in device select activity.
        /// </summary>
        public override void onActivityResult(int requestCode, int resultCode, Intent data)
        {
            if (resultCode == Activity.RESULT_OK)
            {
                mDeviceId = data.getStringExtra("deviceId");
                int type = data.getIntExtra("deviceType", -1);

                if (mDeviceFinder != null && mPickerListener != null)
                {
                    SmcDevice d = mDeviceFinder.getDevice(type, mDeviceId);
                    if (d != null)
                    {
                        mPickerListener.onDeviceSelected(d);
                        Active = true;
                    }
                }
            }
        }
		public override void onDeviceRemoved(SmcDeviceFinder deviceFinder, SmcDevice smcDevice, int error)
		{
			// We aren't interested in individual devices, only in their number
			updateButtonCounter();
			//if current device has been removed
			if (smcDevice.Id.Equals(mDeviceId))
			{
				Active = false;
				if (mPickerListener != null)
				{
					mPickerListener.onAllShareDisabled();
				}
			}
		}
		///////////////////////////////////////////////////////////////////////////
		// These methods handle devices appearing and disappearing in network.
		///////////////////////////////////////////////////////////////////////////

		public override void onDeviceAdded(SmcDeviceFinder deviceFinder, SmcDevice smcDevice)
		{
			// We aren't interested in individual devices, only in their number
			updateButtonCounter();
		}
        ///////////////////////////////////////////////////////////////////////////
        // These methods handle devices appearing and disappearing in network.
        ///////////////////////////////////////////////////////////////////////////

        public override void onDeviceAdded(SmcDeviceFinder deviceFinder, SmcDevice smcDevice)
        {
            // We aren't interested in individual devices, only in their number
            updateButtonCounter();
        }