Example #1
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Mouse.OverrideCursor = Cursors.Wait;
                /* Create a new environment */
                Environment environment = new Environment()
                {
                    Name   = txtName.Text,
                    Width  = int.Parse(txtWidth.Text),
                    Height = int.Parse(txtHeight.Text),
                    DistanceBetweenReferencePoints = int.Parse(txtDistanceBetweenRefPoints.Text),
                    Timestamp = DateTime.Now,
                };
                IndoorPositioningClient.AddEnvironment(environment);

                /* Load the list again */
                Load();
                Mouse.OverrideCursor = Cursors.Arrow;
            }
            catch (Exception ex)
            {
                Mouse.OverrideCursor = Cursors.Arrow;
                MessageBox.Show(ex.ToString());
            }
        }