/// <summary>
 /// Save button clicked
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button_saveApply_Click(object sender, RoutedEventArgs e)
 {
     if (SaveButtonClicked != null)
     {
         SaveButtonClicked.Invoke(sender, e);
     }
     button_saveApply.IsEnabled = false; // set to disabled whenever save is clicked
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            _presenterAddAmend._OrderRef = this.OrderRef.Text;
            _presenterAddAmend._ItemDesc = this.Item.Text;
            _presenterAddAmend._Customer = this.Customer.Text;
            _presenterAddAmend._Qty      = Int32.Parse(this.Qty.Text);
            _presenterAddAmend._UnitCost = Double.Parse(this.UnitCost.Text);

            SaveButtonClicked?.Invoke(this, EventArgs.Empty);
        }
Example #3
0
 private void TaskOnClick()
 {
     if (hasMinValue)
     {
         var total = FindObjectOfType <PopUp_Methods>().GetComponent <PopUp_Methods>().GetTotalValue();
         if (total != minValue && total != 0)
         {
             return;
         }
     }
     SaveButtonClicked?.Invoke(this, new EventArgs());
 }
Example #4
0
        public MainForm()
        {
            BuildLayout();

            Controls.Add(functionsList);
            Controls.Add(functionView);
            Controls.Add(parametersView);
            Controls.Add(actions);

            InitializeComponent();


            functionsList.SelectedFunctionChanged += name => SelectedFunctionChanged.Invoke(name);
            var resetButton = actions.Controls["Reset"];

            resetButton.Click += (sender, args) => ResetButtonClicked.Invoke(functionsList.CurrentSelection());

            var saveButton = actions.Controls["Save"];

            saveButton.Click +=
                (sender, args) =>
            {
                var nameGetter = new NameGetterForm();
                nameGetter.Controls["okButton"].Click += (o, eventArgs) =>
                {
                    var newName = nameGetter.Controls.OfType <TextBox>().First().Text;
                    SaveButtonClicked.Invoke(functionsList.CurrentSelection(), newName,
                                             parametersView.GetCoefficients());
                    nameGetter.Close();
                };
                nameGetter.ShowDialog(this);
            };

            var openButton = actions.Controls["Open"];

            openButton.Click += (sender, args) => { if (OpenCurrent != null)
                                                    {
                                                        OpenCurrent.Invoke(sender, args);
                                                    }
            };

            parametersView.ParameterUpDownsChanged +=
                downs => { if (ParameterUpDownsChanged != null)
                           {
                               ParameterUpDownsChanged.Invoke(downs);
                           }
            };
        }
Example #5
0
        public AddNewBookForm()
        {
            InitializeComponent();

            // disable some buttons initially
            this.saveButton.Enabled            = false;
            this.addNewAuthorButton.Enabled    = false;
            this.addNewPublisherButton.Enabled = false;
            this.addNewTagButton.Enabled       = false;

            this.tagsList.CheckOnClick    = true;
            this.authorsList.CheckOnClick = true;

            this.CenterToParent();

            this.addNewTagButton.Enabled       = true;
            this.addNewPublisherButton.Enabled = true;
            this.addNewAuthorButton.Enabled    = true;

            // set tab order of controls
            this.titleField.TabIndex              = 0;
            this.longTitleField.TabIndex          = 1;
            this.IsbnField.TabIndex               = 2;
            this.Isbn13Field.TabIndex             = 3;
            this.overviewField.TabIndex           = 4;
            this.MsrpField.TabIndex               = 5;
            this.pagesField.TabIndex              = 6;
            this.synopsisField.TabIndex           = 7;
            this.excerptField.TabIndex            = 8;
            this.languageField.TabIndex           = 9;
            this.datePublishedField.TabIndex      = 10;
            this.placeOfPublicationField.TabIndex = 11;
            this.editionField.TabIndex            = 12;
            this.deweyDecimalField.TabIndex       = 13;
            this.formatField.TabIndex             = 14;
            this.dimensionsField.TabIndex         = 15;
            this.notesField.TabIndex              = 16;
            this.browseImageButton.TabIndex       = 17;
            this.imageFilePathField.TabStop       = false;
            this.saveButton.TabIndex              = 18;
            this.cancelButton.TabIndex            = 19;
            this.authorsGroup.TabStop             = false;
            this.authorsList.TabStop              = false;
            this.filterAuthorsField.TabStop       = false;
            this.applyAuthorFilterButton.TabStop  = false;
            this.clearAuthorFilterButton.TabStop  = false;
            this.addNewAuthorButton.TabStop       = false;
            this.tagsGroup.TabStop                  = false;
            this.tagsList.TabStop                   = false;
            this.filterTagField.TabStop             = false;
            this.applyTagFilterButton.TabStop       = false;
            this.clearTagFilterButton.TabStop       = false;
            this.addNewTagButton.TabStop            = false;
            this.publishersGroup.TabStop            = false;
            this.publishersList.TabStop             = false;
            this.filterPublishersField.TabStop      = false;
            this.applyPublisherFilterButton.TabStop = false;
            this.clearPublisherFilterButton.TabStop = false;
            this.addNewPublisherButton.TabStop      = false;

            // register event handlers
            // fire the public event so the subscribed presenter can react
            this.titleField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.longTitleField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.IsbnField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.Isbn13Field.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.overviewField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.MsrpField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.pagesField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.synopsisField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.excerptField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.datePublishedField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.editionField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.deweyDecimalField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.formatField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.dimensionsField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.languageField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.notesField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.saveButton.Click += ((sender, args) =>
            {
                SaveButtonClicked?.Invoke(sender, args);
            });
            this.addNewTagButton.Click += ((sender, args) =>
            {
                this.AddNewTagButtonClicked?.Invoke(sender, args);
            });
            this.tagsList.MouseUp += ((sender, args) =>
            {
                this.TagCheckedChanged?.Invoke(sender, args);
            });
            this.authorsList.MouseUp += ((sender, args) =>
            {
                this.AuthorCheckedChanged?.Invoke(sender, args);
            });
            this.publishersList.SelectedIndexChanged += ((sender, args) =>
            {
                this.InputFieldsUpdated?.Invoke(sender, args);
            });
            this.filterPublishersField.TextChanged += (async(sender, args) =>
            {
                await Task.Delay(MainWindow.FILTER_DELAY);
                this.FilterPublishersFieldUpdated?.Invoke(sender, args);
            });
            this.applyPublisherFilterButton.Click += ((sender, args) =>
            {
                this.FilterPublishersFieldUpdated?.Invoke(sender, args);
            });
            this.filterAuthorsField.TextChanged += (async(sender, args) =>
            {
                await Task.Delay(MainWindow.FILTER_DELAY);
                this.FilterAuthorsFieldUpdated?.Invoke(sender, args);
            });
            this.applyAuthorFilterButton.Click += ((sender, args) =>
            {
                this.FilterAuthorsFieldUpdated?.Invoke(sender, args);
            });
            this.filterTagField.TextChanged += (async(sender, args) =>
            {
                await Task.Delay(MainWindow.FILTER_DELAY);
                this.FilterTagsFieldUpdated?.Invoke(sender, args);
            });
            this.applyTagFilterButton.Click += ((sender, args) =>
            {
                this.FilterTagsFieldUpdated?.Invoke(sender, args);
            });
            this.addNewPublisherButton.Click += ((sender, args) =>
            {
                this.AddNewPublisherButtonClicked?.Invoke(sender, args);
            });
            this.addNewAuthorButton.Click += ((sender, args) =>
            {
                this.AddNewAuthorButtonClicked?.Invoke(sender, args);
            });
            // handle the event here
            this.clearPublisherFilterButton.Click += ((sender, args) =>
            {
                this.filterPublishersField.Text = string.Empty;
            });
            this.clearAuthorFilterButton.Click += ((sender, args) =>
            {
                this.filterAuthorsField.Text = string.Empty;
            });
            this.clearTagFilterButton.Click += ((sender, args) =>
            {
                this.filterTagField.Text = string.Empty;
            });
            this.browseImageButton.Click += ((sender, args) =>
            {
                using (OpenFileDialog dialog = new OpenFileDialog())
                {
                    dialog.Title = MainWindow.LOAD_IMAGE_DIALOG_TITLE;
                    dialog.Filter = MainWindow.LOAD_IMAGE_DIALOG_FILTER;

                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        this.imageFilePathField.Text = dialog.FileName;
                    }
                }
            });
        }
Example #6
0
        // ctor
        public AddNewMediaItemForm()
        {
            InitializeComponent();

            // populate item types drop-down
            this.mediaTypesOptions.Items.Add(ItemType.Cd);
            this.mediaTypesOptions.Items.Add(ItemType.Dvd);
            this.mediaTypesOptions.Items.Add(ItemType.BluRay);
            this.mediaTypesOptions.Items.Add(ItemType.Vhs);
            this.mediaTypesOptions.Items.Add(ItemType.Vinyl);
            this.mediaTypesOptions.Items.Add(ItemType.Other);
            this.mediaTypesOptions.SelectedIndex = 0;

            this.tagsList.CheckOnClick = true;

            this.CenterToParent();

            // set tab order of controls
            this.titleField.TabIndex        = 0;
            this.numberField.TabIndex       = 1;
            this.runningTimeField.TabIndex  = 2;
            this.yearField.TabIndex         = 3;
            this.notesField.TabIndex        = 4;
            this.browseImageButton.TabIndex = 5;
            this.saveButton.TabIndex        = 6;
            this.cancelButton.TabIndex      = 7;
            this.tagsGroup.TabStop          = false;
            this.tagsList.TabStop           = false;
            this.filterTagField.TabStop     = false;
            this.applyFilterButton.TabStop  = false;
            this.clearFilterButton.TabStop  = false;
            this.addNewTagButton.TabStop    = false;
            this.imageFilePathField.TabStop = false;

            this.addNewTagButton.Enabled = true;

            // register event handlers
            // fire the public event so the subscribed presenter can react
            this.titleField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.numberField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.runningTimeField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.yearField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.imageFilePathField.TextChanged += ((sender, args) =>
            {
                InputFieldsUpdated?.Invoke(sender, args);
            });
            this.saveButton.Click += ((sender, args) =>
            {
                SaveButtonClicked?.Invoke(sender, args);
            });
            this.filterTagField.TextChanged += (async(sender, args) =>
            {
                await Task.Delay(MainWindow.FILTER_DELAY);
                this.FilterTagsFieldUpdated?.Invoke(sender, args);
            });
            this.addNewTagButton.Click += ((sender, args) =>
            {
                this.AddNewTagButtonClicked?.Invoke(sender, args);
            });
            this.tagsList.MouseUp += ((sender, args) =>
            {
                this.TagCheckedChanged?.Invoke(sender, args);
            });
            // handle the event here
            this.applyFilterButton.Click += ((sender, args) =>
            {
                this.FilterTagsFieldUpdated?.Invoke(sender, args);
            });
            this.clearFilterButton.Click += ((sender, args) =>
            {
                this.filterTagField.Text = string.Empty;
            });
            this.browseImageButton.Click += ((sender, args) =>
            {
                using (OpenFileDialog dialog = new OpenFileDialog())
                {
                    dialog.Title = MainWindow.LOAD_IMAGE_DIALOG_TITLE;
                    dialog.Filter = MainWindow.LOAD_IMAGE_DIALOG_FILTER;

                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        this.imageFilePathField.Text = dialog.FileName;
                    }
                }
            });
        }
 private void saveButton_Click(object sender, RoutedEventArgs e)
 {
     CopyNote(_internalNote, _externalNote);
     SaveButtonClicked?.Invoke(this, EventArgs.Empty);
 }
 private void Button_Save_Click(object sender, RoutedEventArgs e)
 {
     SaveButtonClicked?.Invoke(this, EventArgs.Empty);
 }
Example #9
0
 protected virtual void OnSaveButtonClicked(RoutedEventArgs e)
 {
     SaveButtonClicked?.Invoke(this, e);
 }
Example #10
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     SaveButtonClicked?.Invoke();
 }