Ejemplo n.º 1
0
        public void OnEndpointFound(string endpointId, string deviceId, string serviceId, string name)
        {
            Log.Debug(TAG, "onEndpointFound:" + endpointId + ":" + name);

            if (mMyListDialog == null)
            {
                var builder = new AlertDialog.Builder(this)
                              .SetTitle("Endpoint(s) Found")
                              .SetCancelable(true)
                              .SetNegativeButton("Cancel", (sender, e) => mMyListDialog.Dismiss());

                // Create the MyListDialog with a listener
                mMyListDialog = new MyListDialog(this, builder, async(sender, e) => {
                    var selectedEndpointName = mMyListDialog.GetItemKey(e.Which);
                    var selectedEndpointId   = mMyListDialog.GetItemValue(e.Which);

                    await ConnectTo(selectedEndpointId, selectedEndpointName);
                    mMyListDialog.Dismiss();
                });
            }

            mMyListDialog.AddItem(name, endpointId);
            mMyListDialog.Show();
        }
Ejemplo n.º 2
0
		public void OnEndpointFound (string endpointId, string deviceId, string serviceId, string name)
		{
			Log.Debug (TAG, "onEndpointFound:" + endpointId + ":" + name);

			if (mMyListDialog == null) {
				var builder = new AlertDialog.Builder (this)
					.SetTitle ("Endpoint(s) Found")
					.SetCancelable (true)
					.SetNegativeButton ("Cancel", (sender, e) => mMyListDialog.Dismiss ());

				// Create the MyListDialog with a listener
				mMyListDialog = new MyListDialog (this, builder, async (sender, e) => { 
					var selectedEndpointName = mMyListDialog.GetItemKey (e.Which);
					var selectedEndpointId = mMyListDialog.GetItemValue (e.Which);

					await ConnectTo (selectedEndpointId, selectedEndpointName);
					mMyListDialog.Dismiss ();
				});
			}

			mMyListDialog.AddItem (name, endpointId);
			mMyListDialog.Show ();
		}