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();
        }
Exemple #4
0
        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();
        }
Exemple #5
0
        public static Person EditPerson(Person p)
        {
            EditWindow ew = new EditWindow(p);

            ew.ShowDialog();
            return(CurrentPerson);
        }
Exemple #6
0
        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();
        }
Exemple #7
0
        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}");
                    }
                }
            }
        }
Exemple #8
0
        private void EditFile(object sender, RoutedEventArgs e)
        {
            EditWindow editWindow = new EditWindow(mw, tbSelected.Text);

            editWindow.ShowDialog();
            BackSelected(null);
        }
        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 btnEdit_Click(object sender, RoutedEventArgs e)
        {
            GetNeedControl(sender);
            EditWindow editWindow = new EditWindow(mw, needControlFileName);

            editWindow.ShowDialog();
        }
Exemple #11
0
        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;
            }
        }
Exemple #12
0
        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);
                }
            }
        }
Exemple #13
0
        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();
        }
        public void EditWithFormsExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            InProgerssStatusBar("Редактирование");
            var f = new EditWindow(_filePath + _copyFileName);

            f.ShowDialog();
            _somethingChanged = true;
            NormalizeStatusBar();
        }
Exemple #15
0
        private void ProductListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var NewEditWindow = new EditWindow(ProductListView.SelectedItem as Product);

            if ((bool)NewEditWindow.ShowDialog())
            {
                ProductList = Globals.DataProvider.GetProducts();
            }
        }
Exemple #16
0
        private void EditDoujin()
        {
            EditWindow editWindow = new EditWindow(SelectedDoujin);

            editWindow.ShowDialog();
            editWindow.Activate();
            editWindow.Focus();
            editWindow.Topmost = true;
        }
Exemple #17
0
        private void EditBtn_Click(object sender, RoutedEventArgs e)
        {
            Student    student    = (Student)StudentsDataGrid.SelectedItem;
            EditWindow editWindow = new EditWindow(student);

            editWindow.Closed += OnEditWindow_Closed;


            editWindow.ShowDialog();
        }
Exemple #18
0
        private bool EditCallBack(IPropertyViewModelCollection Properties)
        {
            EditWindow editWindow;

            editWindow = new EditWindow()
            {
                Owner = this, PropertyViewModelCollection = Properties
            };
            return(editWindow.ShowDialog() ?? false);
        }
Exemple #19
0
        private void Edit_Click(object sender, RoutedEventArgs e)
        {
            EditWindow edit = new EditWindow();

            edit.ShowDialog();
            var temp = RadioStation.SelectedValue;

            bassController.UpdateRadioList();
            RadioStation.ItemsSource   = bassController.Radios;
            RadioStation.SelectedValue = temp;
        }
Exemple #20
0
        private void PropertiesMenuItem_Click(object sender, RoutedEventArgs e)
        {
            Edit_SearchParams view = new Edit_SearchParams();

            view.DataContext = this.SelectedItem;
            view.Width       = 500;

            EditWindow wnd = new EditWindow("Recherche", view);

            wnd.ShowDialog();
        }
        /// <summary>
        /// Funkcja do edytowania zaznaczonej oferty
        /// </summary>
        public void Edit()
        {
            EditOfferViewModel eo = new EditOfferViewModel(CurrentlySelectedOffer, this);
            EditWindow         e  = new EditWindow();

            eo.RequestClose += (x, ev) => CloseWindow(e);
            e.DataContext    = eo;

            //pokaż nowe okno dialogowe do edycji oferty
            e.ShowDialog();
        }
Exemple #22
0
        public bool?ShowDialog(OpenEditWindowArgs args)
        {
            if (SimpleIoc.Default.ContainsCreated <OpenEditWindowArgs>())
            {
                SimpleIoc.Default.Unregister <OpenEditWindowArgs>();
            }
            SimpleIoc.Default.Register(() => args);
            EditWindow editWindow = new EditWindow();

            return(editWindow.ShowDialog());
        }
        private void PropertiesMenuItem_Click(object sender, RoutedEventArgs e)
        {
            Edit_ParamContent view = new Edit_ParamContent();

            view.DataContext = this.SelectedItem;
            view.Width       = 500;

            EditWindow wnd = new EditWindow("Données du paramètre", view);

            wnd.ShowDialog();
        }
        private bool?OpenDialog(Model.Student student, out ViewModel.EW_ViewModel VM)
        {
            var EditForm   = new EditWindow();
            var EditFormVM = new EW_ViewModel(student, EditForm);

            EditForm.DataContext = EditFormVM;
            EditForm.Owner       = WinHandle;
            EditForm.ShowDialog();
            VM = EditFormVM;
            return(EditForm.DialogResult.Value);
        }
Exemple #25
0
        private void PropertiesMenuItem_Click(object sender, RoutedEventArgs e)
        {
            Edit_DatabaseSource view = new Edit_DatabaseSource();

            view.DataContext = this.SelectedItem;
            view.Width       = 500;

            EditWindow wnd = new EditWindow("Source de données", view);

            wnd.ShowDialog();
        }
        private void PropertiesMenuItem_Click(object sender, RoutedEventArgs e)
        {
            Edit_ObjectSyntax view = new Edit_ObjectSyntax();

            view.DataContext = this.SelectedItem;
            view.Width       = 500;

            EditWindow wnd = new EditWindow("Syntaxe d'objet", view);

            wnd.ShowDialog();
        }
Exemple #27
0
        public override void Execute(object parameter)
        {
            DataRowView drv = parameter as DataRowView;

            if (drv != null)
            {
                SearchViewModel model  = Model as SearchViewModel;
                EditWindow      window = new EditWindow(new Contact(drv.Row.ItemArray));
                window.ShowDialog();
                model.SearchResult = null;
            }
        }
Exemple #28
0
 private void BtnEdit_Click(object sender, RoutedEventArgs e)
 {
     if (moviesList.SelectedItem != null)
     {
         EditWindow editWindow = new EditWindow((Movie)moviesList.SelectedItem);
         editWindow.ShowDialog();
     }
     else
     {
         MessageBox.Show("Please select an item to edit.");
     }
 }
Exemple #29
0
        // Utility function that customises a generic item
        // Importantly, makes use of generics to reduce code bloat
        // Takes the abstract EditWindow to actually use (determines the type)
        private void EditData <T>(EditWindow <T> Wnd) where T : DataModel
        {
            // Show the window and store the close result
            bool?Result = Wnd.ShowDialog();

            // If closed succesfully, process the item
            if (Result.HasValue && Result.Value)
            {
                // Acquire the (generic) item
                T New = Wnd.GetItem();
                if (New != null)
                {
                    // Add the item to the relevant table
                    Type t = typeof(T);
                    using (DataRepository Repo = new DataRepository())
                    {
                        if (t == typeof(Booking))
                        {
                            Repo.Bookings.Add((Booking)(object)New);
                        }
                        else if (t == typeof(Class))
                        {
                            Repo.Classes.Add((Class)(object)New);
                        }
                        else if (t == typeof(Department))
                        {
                            Repo.Departments.Add((Department)(object)New);
                        }
                        else if (t == typeof(Room))
                        {
                            Repo.Rooms.Add((Room)(object)New);
                        }
                        else if (t == typeof(Student))
                        {
                            Repo.Users.Add((Student)(object)New);
                        }
                        else if (t == typeof(Subject))
                        {
                            Repo.Subjects.Add((Subject)(object)New);
                        }
                        else if (t == typeof(Teacher))
                        {
                            Repo.Users.Add((Teacher)(object)New);
                        }
                        else if (t == typeof(TimeSlot))
                        {
                            Repo.Periods.Add((TimeSlot)(object)New);
                        }
                    }
                }
            }
        }
Exemple #30
0
        /// <summary>
        /// ШАБЛОН Создание экземпляра окна Транхакция
        /// </summary>
        /// <typeparam name="T">Natural, Legal, VIP</typeparam>
        /// <param name="item"></param>
        private void EditWindow_Template <T>(T item)
        {
            EditWindow editWindow = new EditWindow(Bank, item);

            editWindow.Owner = this;
            this.IsEnabled   = false;
            if (editWindow.ShowDialog() == true)
            {
                editWindow.Show();
                editWindow.Activate();
            }
            this.IsEnabled = true;
        }
        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();
            }
        }
        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();
        }