private void UpdateEditor() { if (mEditorItem != null) { pnlContainer.Show(); txtName.Text = mEditorItem.Name; cmbFolder.Text = mEditorItem.Folder; txtBeforeDesc.Text = mEditorItem.BeforeDescription; txtStartDesc.Text = mEditorItem.StartDescription; txtInProgressDesc.Text = mEditorItem.InProgressDescription; txtEndDesc.Text = mEditorItem.EndDescription; chkRepeatable.Checked = Convert.ToBoolean(mEditorItem.Repeatable); chkQuittable.Checked = Convert.ToBoolean(mEditorItem.Quitable); chkLogBeforeOffer.Checked = Convert.ToBoolean(mEditorItem.LogBeforeOffer); chkLogAfterComplete.Checked = Convert.ToBoolean(mEditorItem.LogAfterComplete); ListQuestTasks(); if (mChanged.IndexOf(mEditorItem) == -1) { mChanged.Add(mEditorItem); mEditorItem.StartEvent?.MakeBackup(); mEditorItem.EndEvent?.MakeBackup(); foreach (var tsk in mEditorItem.Tasks) { tsk.CompletionEvent?.MakeBackup(); tsk.EditingEvent = tsk.CompletionEvent; } mEditorItem.MakeBackup(); } } else { pnlContainer.Hide(); } UpdateToolStripItems(); }
private void UpdateEditor() { if (mEditorItem != null) { pnlContainer.Show(); txtName.Text = mEditorItem.Name; cmbFolder.Text = mEditorItem.Folder; txtBeforeDesc.Text = mEditorItem.BeforeDescription; txtStartDesc.Text = mEditorItem.StartDescription; txtInProgressDesc.Text = mEditorItem.InProgressDescription; txtEndDesc.Text = mEditorItem.EndDescription; chkRepeatable.Checked = Convert.ToBoolean(mEditorItem.Repeatable); chkQuittable.Checked = Convert.ToBoolean(mEditorItem.Quitable); chkLogBeforeOffer.Checked = Convert.ToBoolean(mEditorItem.LogBeforeOffer); chkLogAfterComplete.Checked = Convert.ToBoolean(mEditorItem.LogAfterComplete); chkDoNotShowUnlessReqsMet.Checked = Convert.ToBoolean(mEditorItem.DoNotShowUnlessRequirementsMet); cmbUnstartedCategory.SelectedIndex = cmbUnstartedCategory.Items.IndexOf(mEditorItem.UnstartedCategory ?? ""); cmbInProgressCategory.SelectedIndex = cmbInProgressCategory.Items.IndexOf(mEditorItem.InProgressCategory ?? ""); cmbCompletedCategory.SelectedIndex = cmbCompletedCategory.Items.IndexOf(mEditorItem.CompletedCategory ?? ""); if (cmbUnstartedCategory.SelectedIndex == -1) { cmbUnstartedCategory.SelectedIndex = 0; } if (cmbInProgressCategory.SelectedIndex == -1) { cmbInProgressCategory.SelectedIndex = 0; } if (cmbCompletedCategory.SelectedIndex == -1) { cmbCompletedCategory.SelectedIndex = 0; } nudOrderValue.Value = mEditorItem.OrderValue; ListQuestTasks(); if (mChanged.IndexOf(mEditorItem) == -1) { mChanged.Add(mEditorItem); mEditorItem.StartEvent?.MakeBackup(); mEditorItem.EndEvent?.MakeBackup(); foreach (var tsk in mEditorItem.Tasks) { tsk.CompletionEvent?.MakeBackup(); tsk.EditingEvent = tsk.CompletionEvent; } mEditorItem.MakeBackup(); } } else { pnlContainer.Hide(); } UpdateToolStripItems(); }