private void EditDevice_MenuItem_Click(object sender, RoutedEventArgs e)
 {
     if (null != selectedLeftPane)
     {
         AddNewDevice editDevice = new AddNewDevice(this, AddNewDeviceType.EDIT, int.Parse(selectedLeftPane.Tag.ToString()));
         editDevice.Show();
     }
 }
        private void AddPeerDevice_MenuItem_Click(object sender, RoutedEventArgs e)
        {
            int deviceId = (selectedLeftPane == null) ?-1: int.Parse(selectedLeftPane.Tag.ToString());

            AddNewDevice addNewDevice = new AddNewDevice(this, AddNewDeviceType.PEER, deviceId);

            addNewDevice.Show();
        }
        private void EditDevice_MenuItem_Click(object sender, RoutedEventArgs e)
        {
            if (null != selectedLeftPane)
            {
                AddNewDevice editDevice = new AddNewDevice(this, AddNewDeviceType.EDIT, int.Parse(selectedLeftPane.Tag.ToString()));
                editDevice.Show();
            }

        }
 private void AddSlaveDevice_MenuItem_Click(object sender, RoutedEventArgs e)
 {
     AddNewDevice addNewDevice = new AddNewDevice(this, AddNewDeviceType.SLAVE, int.Parse(selectedLeftPane.Tag.ToString()));
     addNewDevice.Show();
 }
        private void AddPeerDevice_MenuItem_Click(object sender, RoutedEventArgs e)
        {
            int deviceId = (selectedLeftPane == null) ?-1: int.Parse(selectedLeftPane.Tag.ToString());

            AddNewDevice addNewDevice = new AddNewDevice(this, AddNewDeviceType.PEER, deviceId);
            addNewDevice.Show();
        }
        private void AddSlaveDevice_MenuItem_Click(object sender, RoutedEventArgs e)
        {
            AddNewDevice addNewDevice = new AddNewDevice(this, AddNewDeviceType.SLAVE, int.Parse(selectedLeftPane.Tag.ToString()));

            addNewDevice.Show();
        }