コード例 #1
0
ファイル: MainScreen.cs プロジェクト: twlong/xamarin-samples
        void DisconnectMonitor()
        {
            statusLabel.Text          = "Not connected";
            heartRateLabel.Text       = "0";
            heartRateLabel.Hidden     = true;
            heartRateUnitLabel.Hidden = true;
            deviceNameLabel.Text      = String.Empty;
            deviceNameLabel.Hidden    = true;

            if (monitor != null)
            {
                monitor.Dispose();
                monitor = null;
            }
        }
コード例 #2
0
        void DisconnectMonitor()
        {
            statusLabel.StringValue     = "Not connected";
            heartRateLabel.IntValue     = 0;
            heartRateLabel.Hidden       = true;
            heartRateUnitLabel.Hidden   = true;
            rssiLabel.Hidden            = true;
            deviceNameLabel.StringValue = String.Empty;
            deviceNameLabel.Hidden      = true;
            disconnectButton.Hidden     = true;

            if (connectedMonitor != null)
            {
                connectedMonitor.HeartBeat        -= OnHeartBeat;
                connectedMonitor.HeartRateUpdated -= OnHeartRateUpdated;
                connectedMonitor.RssiUpdated      -= OnRssiUpdated;
                connectedMonitor.NameUpdated      -= OnNameUpdated;
                connectedMonitor.Dispose();
                connectedMonitor = null;
            }
        }