private void btnOK_Click(object sender, RoutedEventArgs e) { ContentControl path = (cmbPath.SelectedItem as ContentControl); string pathStr = path != null ? (path.Tag as string) : cmbPath.Text; if (radProgram.IsChecked == true) { ID = ProgramID.NewProgID(pathStr); } else if (radService.IsChecked == true) { ServiceModel.Service svc = (cmbService.SelectedItem as ServiceModel.Service); ID = ProgramID.NewSvcID(svc != null ? svc.Value : cmbService.Text, pathStr); } else if (radApp.IsChecked == true) { AppModel.AppPkg name = (cmbApp.SelectedItem as AppModel.AppPkg); ID = ProgramID.NewAppID(name != null ? name.Value : cmbApp.Text, pathStr); } else { ID = ProgramID.NewID(ProgramID.Types.Global); } this.DialogResult = true; }
private void btnOK_Click(object sender, RoutedEventArgs e) { if (radProgram.IsChecked == true) { ID.Type = ProgramList.Types.Program; ContentControl path = (cmbPath.SelectedItem as ContentControl); ID.Path = path != null ? (path.Tag as string) : cmbPath.Text; ID.Name = ""; } else if (radService.IsChecked == true) { ID.Type = ProgramList.Types.Service; ContentControl path = (cmbPath.SelectedItem as ContentControl); ID.Path = path != null ? (path.Tag as string) : cmbPath.Text; ServiceModel.Service name = (cmbService.SelectedItem as ServiceModel.Service); ID.Name = name != null ? name.Value : cmbService.Text; } else if (radProgram.IsChecked == true) { ID.Type = ProgramList.Types.Program; ContentControl path = (cmbPath.SelectedItem as ContentControl); ID.Path = path != null ? (path.Tag as string) : cmbPath.Text; AppModel.App name = (cmbApp.SelectedItem as AppModel.App); ID.Name = name != null ? name.Value : cmbApp.Text; } this.DialogResult = true; }
private void CmbService_SelectionChanged(object sender, SelectionChangedEventArgs e) { ServiceModel.Service svc = (cmbService.SelectedItem as ServiceModel.Service); cmbPath.Text = svc?.Path ?? ""; }