コード例 #1
0
ファイル: DevicesActivity.cs プロジェクト: Duet3D/FindMyDuet
        private async Task ScanNetwork(bool firstStart)
        {
            RunOnUiThread(() =>
            {
                SetScanState(true);
                FindViewById <ListView>(Resource.Id.lvDevices).Adapter = null;
            });

            try
            {
                mlock.Acquire();
                await finder.DiscoverBoards();
            }
            finally
            {
                mlock.Release();
            }

            RunOnUiThread(() =>
            {
                SetScanState(false);

                FindViewById <ListView>(Resource.Id.lvDevices).Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, finder.Boards.ToList());
                if (firstStart && finder.Boards.Count == 1)
                {
                    // If the app is starting and there is only one device available, connect to it immediately
                    GoToIP(finder.Boards[0].IPAddress);
                }
            });
        }
コード例 #2
0
ファイル: MainActivity.cs プロジェクト: softlion/Zeroconf
 protected override void OnDestroy()
 {
     if (mlock != null)
     {
         mlock.Release();
         mlock = null;
     }
     base.OnDestroy();
 }
コード例 #3
0
        protected override void OnDestroy()
        {
            //base.OnDestroy();
            if (_mlock != null)
            {
                _mlock.Release();
                _mlock = null;
            }

            base.OnDestroy();
        }
コード例 #4
0
 public void Dispose()
 {
     if (_mcLock != null)
     {
         _mcLock.Release();
         _mcLock.Dispose();
     }
     if (_httpServer != null)
     {
         _httpServer.Dispose();
     }
     if (_udpServer != null)
     {
         _udpServer.Dispose();
     }
 }