コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: noontrix/KIP
 private void dispose_Click(object sender, RoutedEventArgs e)
 {
     if (device != null)
     {
         device.Dispose();
         device = null;
     }
 }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: noontrix/KIP
        // TODO - Declare a delegate to reference NewMeasurementEvent handler.

        private void startCollecting_Click(object sender, RoutedEventArgs e)
        {
            if (device == null)
            {
                device = new MeasureMassDevice(Units.Metric, "LogFile.txt");
            }

            // TODO - Use a delegate to refer to the event handler.
            // Hook up the delegate to an event handler method.

            // TODO - Hook up the event handler to the event.

            loggingFileNameBox.Text = device.GetLoggingFile();
            unitsBox.Text           = device.UnitsToUse.ToString();

            device.StartCollecting();
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: noontrix/KIP
        private void startCollecting_Click(object sender, RoutedEventArgs e)
        {
            if (device == null)
            {
                device = new MeasureMassDevice(Units.Metric, "LogFile.txt");
            }

            // Hook up the delegate to an event handler method.
            newMeasurementTaken = new EventHandler(device_NewMeasurementTaken);

            device.NewMeasurementTaken += newMeasurementTaken;

            loggingFileNameBox.Text = device.GetLoggingFile();
            unitsBox.Text           = device.UnitsToUse.ToString();

            device.StartCollecting();
        }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: noontrix/KIP
        private void startCollecting_Click(object sender, RoutedEventArgs e)
        {
            if (device == null)
            {
                device = new MeasureMassDevice(Units.Metric, "LogFile.txt");
            }

            // Hook up the delegate to an event handler method.
            newMeasurementTaken = new EventHandler(device_NewMeasurementTaken);

            device.NewMeasurementTaken += newMeasurementTaken;

            device.HeartBeat += (o, args) =>
            {
                heartBeatTimeStamp.Content =
                    string.Format("HeartBeat Timestamp: {0}", args.TimeStamp);
            };

            loggingFileNameBox.Text = device.GetLoggingFile();
            unitsBox.Text           = device.UnitsToUse.ToString();

            device.StartCollecting();
        }