Coded cleanup

This commit is contained in:
2024-04-03 08:57:42 -04:00
parent 177237699e
commit 0d50c5db83
3 changed files with 4 additions and 38 deletions

View File

@@ -12,7 +12,7 @@
event EventHandler? BrowseButtonClicked; event EventHandler? BrowseButtonClicked;
event EventHandler<string>? LaunchButtonClicked; event EventHandler<string>? LaunchButtonClicked;
event EventHandler<MaintainSermonFilerModel>? SaveButtonClicked; event EventHandler<MaintainSermonFilerModel>? SaveButtonClicked;
event EventHandler? CancelButtonClicked; event EventHandler<int>? CancelButtonClicked;
} }
} }

View File

@@ -62,8 +62,6 @@ namespace MVPLearning.RecordKeeping.SermonFiler
ButtonSave = new Button(); ButtonSave = new Button();
ButtonCancel = new Button(); ButtonCancel = new Button();
LabelTitleWarning = new Label(); LabelTitleWarning = new Label();
button1 = new Button();
button2 = new Button();
ActionPanel.SuspendLayout(); ActionPanel.SuspendLayout();
SuspendLayout(); SuspendLayout();
// //
@@ -365,33 +363,11 @@ namespace MVPLearning.RecordKeeping.SermonFiler
LabelTitleWarning.Text = "Title cannont be blank"; LabelTitleWarning.Text = "Title cannont be blank";
LabelTitleWarning.Visible = false; LabelTitleWarning.Visible = false;
// //
// button1
//
button1.Location = new Point(517, 142);
button1.Name = "button1";
button1.Size = new Size(75, 23);
button1.TabIndex = 26;
button1.Text = "Rebind";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// button2
//
button2.Location = new Point(517, 177);
button2.Name = "button2";
button2.Size = new Size(75, 23);
button2.TabIndex = 27;
button2.Text = "button2";
button2.UseVisualStyleBackColor = true;
button2.Click += button2_Click;
//
// MaintainSermonFilerView // MaintainSermonFilerView
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450); ClientSize = new Size(800, 450);
Controls.Add(button2);
Controls.Add(button1);
Controls.Add(LabelTitleWarning); Controls.Add(LabelTitleWarning);
Controls.Add(ButtonCancel); Controls.Add(ButtonCancel);
Controls.Add(ButtonSave); Controls.Add(ButtonSave);
@@ -459,7 +435,5 @@ namespace MVPLearning.RecordKeeping.SermonFiler
private Button ButtonSave; private Button ButtonSave;
private Button ButtonCancel; private Button ButtonCancel;
private Label LabelTitleWarning; private Label LabelTitleWarning;
private Button button1;
private Button button2;
} }
} }

View File

@@ -126,7 +126,7 @@ namespace MVPLearning.RecordKeeping.SermonFiler
public event EventHandler? BrowseButtonClicked; public event EventHandler? BrowseButtonClicked;
public event EventHandler<string>? LaunchButtonClicked; public event EventHandler<string>? LaunchButtonClicked;
public event EventHandler<MaintainSermonFilerModel>? SaveButtonClicked; public event EventHandler<MaintainSermonFilerModel>? SaveButtonClicked;
public event EventHandler? CancelButtonClicked; public event EventHandler<int>? CancelButtonClicked;
private void AddButton_Click(object sender, EventArgs _) { if (CheckForChangedData()) { AddButtonClicked?.Invoke(sender, EventArgs.Empty); } } private void AddButton_Click(object sender, EventArgs _) { if (CheckForChangedData()) { AddButtonClicked?.Invoke(sender, EventArgs.Empty); } }
private void DeleteButton_Click(object sender, EventArgs _) { DeleteButtonClicked?.Invoke(sender, _model.Seid); } private void DeleteButton_Click(object sender, EventArgs _) { DeleteButtonClicked?.Invoke(sender, _model.Seid); }
@@ -137,7 +137,7 @@ namespace MVPLearning.RecordKeeping.SermonFiler
private void BrowseButton_Click(object sender, EventArgs _) { if (CheckForChangedData()) { BrowseButtonClicked?.Invoke(sender, EventArgs.Empty); } } private void BrowseButton_Click(object sender, EventArgs _) { if (CheckForChangedData()) { BrowseButtonClicked?.Invoke(sender, EventArgs.Empty); } }
private void LaunchButton_Click(object sender, EventArgs _) { LaunchButtonClicked?.Invoke(sender, _model.Filename); } private void LaunchButton_Click(object sender, EventArgs _) { LaunchButtonClicked?.Invoke(sender, _model.Filename); }
private void SaveButton_Click(object sender, EventArgs _) { SaveButtonClicked?.Invoke(sender, _model); } private void SaveButton_Click(object sender, EventArgs _) { SaveButtonClicked?.Invoke(sender, _model); }
private void CancelButton_Click(object sender, EventArgs _) { if (_loadedModel != null) { LoadData(_loadedModel); } } private void CancelButton_Click(object sender, EventArgs _) { CancelButtonClicked?.Invoke(sender, _model.Seid); }
@@ -154,14 +154,6 @@ namespace MVPLearning.RecordKeeping.SermonFiler
return true; return true;
} }
private void button1_Click(object sender, EventArgs e)
{
BindControls();
}
private void button2_Click(object sender, EventArgs e)
{
this.Refresh();
}
} }
} }