public void editAnnouncement() { EditWindow editWindow = new EditWindow(SelectedItem); editWindow.ShowDialog(); update(); }
private void Menu_EditItem_Click(object sender, RoutedEventArgs e) { LocationList items = (LocationList)Resources["LocationList"]; int index = items.CurrentIndex; try { //create Window to prompt user for data. var editItemWindow = new EditWindow(items[index]); //if 'OK' pressed if (editItemWindow.ShowDialog() == true) { //Get data from create-window. string Name = editItemWindow.Name; string Street = editItemWindow.Street; int StreetNum = editItemWindow.StreetNum; int ZipCode = editItemWindow.ZipCode; string City = editItemWindow.City; string TreeMonitorList = editItemWindow.TreeMonitorList; //Create new item with data. Location item = new Location(Name, Street, StreetNum, ZipCode, City, TreeMonitorList); //Replace item with edited item. items[index] = item; } } catch { MessageBox.Show("Please choose an item from the List to edit."); } }
//Senne & Hermes //Opent een nieuw scherm naar Edit pagina. private void EditScherm(Window window) { EditWindow editWindow = new EditWindow(PlantenResultaat, LoggedInGebruiker); window.Close(); editWindow.ShowDialog(); }
private void CreateEditWindow(OpenEditWindowMessage message) { EditWindow win = new EditWindow(); win.Show(); Messenger.Default.Send(new AlarmEditingMessage(message.Alarm)); }
void ViewModel_RequestShowNodeRename(object sender, NodeDialogEventArgs e) { if (e.Handled) { return; } e.Handled = true; var editWindow = new EditWindow(viewModel.DynamoViewModel, false, true) { DataContext = ViewModel, Title = Dynamo.Wpf.Properties.Resources.EditNodeWindowTitle }; editWindow.Owner = Window.GetWindow(this); editWindow.BindToProperty(null, new Binding("NickName") { Mode = BindingMode.TwoWay, NotifyOnValidationError = false, Source = ViewModel, UpdateSourceTrigger = UpdateSourceTrigger.Explicit }); editWindow.ShowDialog(); }
private void EditWithEditWindow(string selectedFile) { if (InvokeRequired) { Invoke((Action <string>)EditWithEditWindow, selectedFile); return; } var content = passwordManager.DecryptText(selectedFile); using (var window = new EditWindow(selectedFile, content)) { if (window.ShowDialog() ?? false) { try { File.Delete(passwordManager.GetPasswordFilePath(selectedFile)); passwordManager.EncryptText(window.PasswordContent.Text, selectedFile); git?.EditPassword(selectedFile); if (ConfigManager.Config.Notifications.Types.PasswordUpdated) { RaiseNotification($"Password file \"{selectedFile}\" has been updated.", ToolTipIcon.Info); } } catch (Exception e) { ShowErrorWindow($"Unable to save your password (encryption failed): {e.Message}"); } } } }
private void ButtonEdit() { EditWindow editWindow = new EditWindow(); editWindow.DataContext = new EditViewModel(SelectedCd, Musicians, Languages, Distributors, Genres); editWindow.Show(); }
public void EditWidget(object parameter) { // // create WidgetOperation object to pass with the current SelectedWidget object // open add window // WidgetOperation widgetOperation = new WidgetOperation() { Status = WidgetOperation.OperationStatus.CANCEL, Widget = SelectedWidget }; Window editWidgetWindow = new EditWindow(widgetOperation); editWidgetWindow.ShowDialog(); // // TODO consider refactoring and use a class with the Widget object and status // if (widgetOperation.Status != WidgetOperation.OperationStatus.CANCEL) { Widgets.Remove(SelectedWidget); Widgets.Add(widgetOperation.Widget); SelectedWidget = widgetOperation.Widget; } }
private void button1_Click(object sender, EventArgs e) { try { string str = FindTextBox.Text; if (LastSearched == str) { FindPos = EditWindow.Find(str, FindPos + LastSearched.Length, RichTextBoxFinds.None); LastSearched = str; } else { FindPos = EditWindow.Find(str, 0, RichTextBoxFinds.None); LastSearched = str; } EditWindow.SelectionStart = FindPos; EditWindow.ScrollToCaret(); EditWindow.Select(FindPos, LastSearched.Length); EditWindow.Refresh(); } catch (Exception x) { MessageBox.Show(x.Message); } }
public static Person EditPerson(Person p) { EditWindow ew = new EditWindow(p); ew.ShowDialog(); return(CurrentPerson); }
private void EditFile(object sender, RoutedEventArgs e) { EditWindow editWindow = new EditWindow(mw, tbSelected.Text); editWindow.ShowDialog(); BackSelected(null); }
private void btnEdit_Click(object sender, RoutedEventArgs e) { GetNeedControl(sender); EditWindow editWindow = new EditWindow(mw, needControlFileName); editWindow.ShowDialog(); }
private void ModifyUser(object parameter) { log.Debug("Modify user button"); PasswordBox pwBox = (PasswordBox)parameter; string OldPassword = pwBox.Password; if (string.IsNullOrWhiteSpace(_oldUserID) || string.IsNullOrWhiteSpace(OldPassword) || string.IsNullOrWhiteSpace(UserID) || string.IsNullOrWhiteSpace(Password) || string.IsNullOrWhiteSpace(Confirm)) { NotificationProvider.Error("Edit user error", "Please fill the Username and Password fieleds."); } else { try { if (UserLogin.ModifyUser(_oldUserID, OldPassword, UserID, Password, Confirm)) { NotificationProvider.Info(String.Format("User modified: {0}", _oldUserID), String.Format("New username: {0}", UserID)); EditWindow?.Close(); } else { NotificationProvider.Error("Edit user error", "Database error"); } } catch (ArgumentException e) { switch (e.ParamName) { case "oldUserID": NotificationProvider.Error("Edit user error", "The original username is missing from the database."); break; case "oldPassword": NotificationProvider.Error("Edit user error", "The old password is wrong."); break; case "newUserId": NotificationProvider.Error("Edit user error", "The new username already exist."); break; case "password": NotificationProvider.Error("Edit user error", "Please fill the password field."); break; case "confirm": NotificationProvider.Error("Edit user error", "Password does not match the confirm password."); break; default: NotificationProvider.Error("Edit user error", "UserLogin error"); break; } } } }
private void btnAutoEdit_Click(object sender, RoutedEventArgs e) { EditWindow editWin = new EditWindow(); var car = (CarViewModel)lBox.SelectedItem; var dealer = (DealerViewModel)cBoxDealer.SelectedItem; editWin.tbModel.Text = car.Model; editWin.tbYear.Text = car.Year.ToString(); editWin.tbColor.Text = car.Color.ToString(); editWin.tbPrice.Text = car.Price.ToString(); editWin.tbEngine.Text = car.EngineVolume; editWin.tbFile.Text = car.CarImageFileName; if (editWin.ShowDialog() == true) { if (editWin.DialogResult == true) { car.Model = editWin.tbModel.Text; car.Year = int.Parse(editWin.tbYear.Text); car.Color = editWin.tbColor.Text; car.EngineVolume = editWin.tbEngine.Text; car.Price = decimal.Parse(editWin.tbPrice.Text); car.CarImageFileName = editWin.tbFile.Text; //????????????? //dealerService.UpdateCar(car); } } }
private void OnEditItemClick(object sender, RoutedEventArgs e) { if (ViewModel.WorkspaceViewModel.Zoom > MINIMUM_ZOOM_DIRECT_NODE_EDIT) { Panel.SetZIndex(noteTextBox, 1); ViewModel.IsOnEditMode = true; noteTextBox.Focus(); noteTextBox.SelectAll(); return; } // Setup a binding with the edit window's text field var dynamoViewModel = ViewModel.WorkspaceViewModel.DynamoViewModel; editWindow = new EditWindow(dynamoViewModel, true) { Title = Dynamo.Wpf.Properties.Resources.EditNoteWindowTitle }; editWindow.EditTextBoxPreviewKeyDown += noteTextBox_PreviewKeyDown; editWindow.Closed += EditWindow_Closed; editWindow.BindToProperty(DataContext, new Binding("Text") { Mode = BindingMode.TwoWay, Source = (DataContext as NoteViewModel), UpdateSourceTrigger = UpdateSourceTrigger.Explicit }); editWindow.ShowDialog(); }
private void Edit_Click(object sender, RoutedEventArgs e) { var item = MainDataGrid.SelectedItem as Bank_Card; EditWindow ew = new EditWindow(item); ew.Show(); }
private void OpenEditWindow(object obj) { var editWindow = new EditWindow(); editWindow.Show(); editWindow.VM.LoadProperties(Model); }
private void EditWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (shutdown) { } else { e.Cancel = true; if (tbxEdit.Text != content) { MessageBoxResult result = MessageBox.Show("Are you sure you want to Close this window?\nAll your changes will be undone.", "Warning!", MessageBoxButton.YesNo, MessageBoxImage.Exclamation); if (result == MessageBoxResult.Yes) { tbxEdit.Text = ""; EditWindow.Title = ""; EditWindow.Hide(); } } else { tbxEdit.Text = ""; EditWindow.Title = ""; EditWindow.Hide(); } } }
public Task <bool?> InitModification(CoreViewModel vm) { var tcs = new TaskCompletionSource <bool?>(); _dispatcherService.CurrentDispatcher.BeginInvoke(new Action(() => { bool?result = null; Window activeWindow = null; for (var i = 0; i < Application.Current.Windows.Count; i++) { var win = Application.Current.Windows[i]; if ((win != null) && (win.IsActive)) { activeWindow = win; break; } } if (activeWindow != null) { var win = new EditWindow(vm) { Owner = activeWindow }; result = win.ShowDialog(); } tcs.SetResult(result); })); return(tcs.Task); }
private void editItem_Click(object sender, RoutedEventArgs e) { var editWindow = new EditWindow(); editWindow.editText.TextChanged += delegate { var expr = editWindow.editText.GetBindingExpression(TextBox.TextProperty); if (expr != null) { expr.UpdateSource(); } }; //setup a binding with the edit window's text field editWindow.editText.DataContext = DataContext as NoteViewModel; var bindingVal = new Binding("Text") { Mode = BindingMode.TwoWay, Source = (DataContext as NoteViewModel), UpdateSourceTrigger = UpdateSourceTrigger.Explicit }; editWindow.editText.SetBinding(TextBox.TextProperty, bindingVal); editWindow.ShowDialog(); }
private void editBtn_Click(object sender, RoutedEventArgs e) { CustomPolitcian politcian = parliamentGrid.SelectedItem as CustomPolitcian; EditWindow edit = new EditWindow(politcian); edit.Show(); edit.Unloaded += Edit_Unloaded;; }
protected void OnEditActionActivated(object sender, EventArgs e) { EditWindow eWin = new EditWindow(); eWin.ShowAll(); this.Destroy(); }
private void OnGUI() { GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("新建脚本", GUILayout.Width(250), GUILayout.Height(50))) { //新建脚本 Debug.Log("新建脚本"); Rect rect = new Rect(50, 50, 520, 500); EditWindow window = (EditWindow)GetWindowWithRect(typeof(EditWindow), rect, true); GlobalState.datas = new List <BaseData>(); } if (GUILayout.Button("打开上次编辑的脚本", GUILayout.Width(250), GUILayout.Height(50))) { //打开脚本 Debug.Log("打开脚本"); string path = null; if (File.Exists(GlobalState.editSaveData)) { StreamReader sr = new StreamReader(GlobalState.editSaveData); while (!sr.EndOfStream) { path = sr.ReadLine(); } sr.Dispose(); sr.Close(); OpenWindow window = (OpenWindow)GetWindow(typeof(OpenWindow), true); window.openScenario = AssetDatabase.LoadAssetAtPath(path, typeof(TextAsset)) as TextAsset; window.Show(); } else { Debug.LogError("未找到存档文件"); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("保存脚本", GUILayout.Width(250), GUILayout.Height(50))) { //保存脚本 Debug.Log("保存脚本"); SaveWindow window = (SaveWindow)GetWindowWithRect(typeof(SaveWindow), new Rect(0, 0, 500, 50), true); window.Show(); } if (GUILayout.Button("查看脚本", GUILayout.Width(250), GUILayout.Height(50))) { //查看脚本 Debug.Log("查看脚本"); OpenWindow window = (OpenWindow)GetWindow(typeof(OpenWindow), true); window.Show(); } GUILayout.EndHorizontal(); }
private void btnEditSubmit_Click(object sender, RoutedEventArgs e) { txtBxEditDestName.GetBindingExpression(TextBox.TextProperty).UpdateSource(); txtBxEditDestDept.GetBindingExpression(TextBox.TextProperty).UpdateSource(); txtBxSEditSenderName.GetBindingExpression(TextBox.TextProperty).UpdateSource(); txtEditBxSenderDept.GetBindingExpression(TextBox.TextProperty).UpdateSource(); txtBxEditNotes.GetBindingExpression(TextBox.TextProperty).UpdateSource(); EditWindow.Close(); }
private void ProductListView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var NewEditWindow = new EditWindow(ProductListView.SelectedItem as Product); if ((bool)NewEditWindow.ShowDialog()) { ProductList = Globals.DataProvider.GetProducts(); } }
private void EditDoujin() { EditWindow editWindow = new EditWindow(SelectedDoujin); editWindow.ShowDialog(); editWindow.Activate(); editWindow.Focus(); editWindow.Topmost = true; }
public void EditWithFormsExecuted(object sender, ExecutedRoutedEventArgs e) { InProgerssStatusBar("Редактирование"); var f = new EditWindow(_filePath + _copyFileName); f.ShowDialog(); _somethingChanged = true; NormalizeStatusBar(); }
/// <summary> /// Метод вызывает окно редактирования для заданного номера документа. /// </summary> /// <param name="connection">Строка соединения с БД</param> /// <param name="docnum">Номер редактируемого документа</param> /// <returns>Возвращает окно для редактирования</returns> public Window EditDocument(string connection, int docnum) { Document document = new Document(); document.Load(connection, docnum); Window form = new EditWindow(document); return(form); }
public void EditBook(object o) { EditWindow eb = new EditWindow(); this.Window.Hide(); eb.Show(); eb.ShowInTaskbar = false; eb.Activate(); }
private bool EditCallBack(IPropertyViewModelCollection Properties) { EditWindow editWindow; editWindow = new EditWindow() { Owner = this, PropertyViewModelCollection = Properties }; return(editWindow.ShowDialog() ?? false); }
private void ObjectsDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var vm = DataContext as CharacterVm; if (vm == null) return; if (ObjectsDataGrid.SelectedIndex != -1) { var model = ObjectsDataGrid.SelectedItem as BaseModel; if (model == null) return; var editWindow = new EditWindow(model, vm.LoggedInUser); editWindow.ShowDialog(); } }
protected void OnEditActionActivated (object sender, EventArgs e) { TreeIter treeIter; treeView.Selection.GetSelected (out treeIter); object id = listStore.GetValue (treeIter, 0); EditWindow editionWindow = new EditWindow (Convert.ToInt32(id)); editionWindow.DeleteEvent += delegate { printCategoria(); }; }
private void CostomizeButtonsEditor() { EditorGUILayout.BeginHorizontal(); FlexibleSpace(5); if (GUILayout.Button(new GUIContent("add", "Add new detail"))) { m_detailContainer = DefaultPrototype; m_detailAddMenu = EditWindow.Add; } int canEdit = -1; for (int i = 0; i < component.TerrainData.detailPrototypes.Length; i++) { if (component.Foliages.IsSelected(i)) { canEdit++; } } GUI.enabled = canEdit == 0; if (GUILayout.Button(new GUIContent("edit", "Edit current selected detail"))) { for (int i = 0; i < component.TerrainData.detailPrototypes.Length; i++) { if (component.Foliages.IsSelected(i)) { m_detailContainer = component.TerrainData.detailPrototypes[i]; break; } } m_detailAddMenu = EditWindow.Edit; } GUI.enabled = canEdit >= 0; if (GUILayout.Button(new GUIContent("remove", "remove current selected " + (canEdit > 0 ? "textures" : "texture")))) { m_detailAddMenu = EditWindow.Remove; } GUI.enabled = true; EditorGUILayout.EndHorizontal(); }
private void CancelPrototypeEditor() { m_detailContainer = null; m_detailAddMenu = EditWindow.None; }
protected void OnEditActionActivated(object sender, EventArgs e) { EditWindow ew = new EditWindow (this.mySqlConnection); ew.Show (); }
private void CreateObjectButton_Click(object sender, RoutedEventArgs e) { //TODO: last thing I need to figure out var vm = DataContext as CharacterVm; if (vm == null) return; var model = vm.CreateNewType(); var editWindow = new EditWindow(model, vm.LoggedInUser, true); editWindow.ShowDialog(); }