public void OnCreateNetworkButtonClick(object sender, System.EventArgs e)
 {
     if (localHotspot == null)
     {
         if (!Utils.HasPermission(ApplicationContext, Utils.ePermission.HotSpotPermission))
         {
             Toast.MakeText(ApplicationContext, "Application requires some HotSpotPermissions!.", ToastLength.Long).Show();
             RequestPermissions(Utils.RequiredHotSpotPermissions, 0);
             return;
         }
         if (!Utils.HasPermission(ApplicationContext, Utils.ePermission.LocationPermission))
         {
             var GetPermissions = Utils.GetPermissions();
         }
         else
         {
             buttonCreateHotspot.Visibility = ViewStates.Invisible;
             textMessage.Text = Utils.PleaseWaitMessage;
             if (wifiManager.IsWifiEnabled)
             {
                 wifiManager.SetWifiEnabled(false);
             }
             localHotspot = new LocalHotspot(ApplicationContext);
             localHotspot.SetNetworkState(true);
         }
     }
     else
     {
         localHotspot.SetNetworkState(false);
         localHotspot = null;
     }
 }
 private void DettachCallbacks()
 {
     if (localHotspot != null)
     {
         localHotspot.SetNetworkState(false);
         localHotspot = null;
     }
     buttonCreateHotspot.Click -= OnCreateNetworkButtonClick;
     buttonSendMessage.Click   -= OnMessageSendButtonClick;
     LocalHotspot.StateChange  -= OnHotspotStateChange;
 }
 public HotSpotCallback(Social_Network_App.LocalHotspot hotSpot)
 {
     _hotSpot = hotSpot;
 }