private void tbName_Validating(object sender, EventArgs e) { bool cancel = false; if (string.IsNullOrWhiteSpace(tbName.Text) && SupplementNames.Length > 0) { cancel = true; MessageDialog md = new MessageDialog(MainWidget.Toplevel as Window, DialogFlags.Modal, MessageType.Warning, ButtonsType.Ok, "You must provide a name for the supplement"); md.Title = "Invalid entry"; md.Run(); md.Destroy(); } if (!cancel) { if (SuppAttrChanged != null) { TStringArgs args = new TStringArgs(); args.name = tbName.Text; if (SuppNameChanged != null) { SuppNameChanged.Invoke(sender, args); } } } }
private void OnSupplementAdded(object sender, TStringArgs e) { suppIdx = supplement.Add(e.name); PopulateSupplementNames(); supplementView.SelectedSupplementValues = supplement[suppIdx]; supplementView.SelectedSupplementIndex = suppIdx - 1; // Offset by 1 to skip fodder }
private void lbDefaultNames_Click(object sender, EventArgs e) { if (SupplementAdded != null && lbDefaultNames.SelectedIndex > 0) { TStringArgs args = new TStringArgs(); args.name = (string)lbDefaultNames.Items[lbDefaultNames.SelectedIndex]; SupplementAdded.Invoke(sender, args); } lbDefaultNames.Visible = false; }
/// <summary> /// Add a supplement /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">The arguments</param> private void OnSupplementAdded(object sender, TStringArgs e) { try { this.explorerPresenter.CommandHistory.Add(new Commands.AddSupplementCommand(supplement, e.Name)); } catch (Exception err) { explorerPresenter.MainPresenter.ShowError(err); } }
/// <summary> /// Change supplement name /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">The arguments</param> private void OnSuppNameChanged(object sender, TStringArgs e) { try { explorerPresenter.CommandHistory.Add(new Commands.ChangeProperty(supplement[supplement.CurIndex], "Name", e.Name)); } catch (Exception err) { explorerPresenter.MainPresenter.ShowError(err); } }
private void lbDefaultNames_Click(object sender, ItemActivatedArgs e) { if (SupplementAdded != null && e.Path.Indices[0] > 0) { TreeIter iter; if (defNameList.GetIter(out iter, e.Path)) { TStringArgs args = new TStringArgs(); args.name = (string)defNameList.GetValue(iter, 0); SupplementAdded.Invoke(sender, args); } } lbDefaultNames.Visible = false; }
private void tbName_Validating(object sender, CancelEventArgs e) { if (string.IsNullOrWhiteSpace(tbName.Text)) { e.Cancel = true; MessageBox.Show(String.Format("You must provide a name for the supplement")); } if (!e.Cancel && tbName.Modified) { if (SuppAttrChanged != null) { TStringArgs args = new TStringArgs(); args.name = tbName.Text; SuppNameChanged.Invoke(sender, args); tbName.Modified = false; } } }
private void LbDefaultNames_Click(object sender, ItemActivatedArgs e) { try { if (SupplementAdded != null && e.Path.Indices[0] > 0) { TreeIter iter; if (defNameList.GetIter(out iter, e.Path)) { TStringArgs args = new TStringArgs(); args.Name = (string)defNameList.GetValue(iter, 0); if (SupplementAdded != null) { SupplementAdded.Invoke(sender, args); } } } lblDefaultNames.Visible = false; } catch (Exception err) { ShowError(err); } }
private void OnSuppNameChanged(object sender, TStringArgs e) { supplement[suppIdx].sName = e.name; }
private void OnSuppNameChanged(object sender, TStringArgs e) { supplement[suppIdx].sName = e.name; this.supplementView.SelectedSupplementName = e.name; }
private void tbName_Validating(object sender, EventArgs e) { bool cancel = false; if (string.IsNullOrWhiteSpace(tbName.Text)) { cancel = true; MessageDialog md = new MessageDialog(MainWidget.Toplevel as Window, DialogFlags.Modal, MessageType.Warning, ButtonsType.Ok, "You must provide a name for the supplement"); md.Title = "Invalid entry"; md.Run(); md.Destroy(); } if (!cancel) { if (SuppAttrChanged != null) { TStringArgs args = new TStringArgs(); args.name = tbName.Text; SuppNameChanged.Invoke(sender, args); } } }
/// <summary> /// Change supplement name /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">The arguments</param> private void OnSuppNameChanged(object sender, TStringArgs e) { this.explorerPresenter.CommandHistory.Add(new Commands.ChangeProperty(supplement[supplement.CurIndex], "Name", e.name)); }
/// <summary> /// Add a supplement /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">The arguments</param> private void OnSupplementAdded(object sender, TStringArgs e) { this.explorerPresenter.CommandHistory.Add(new Commands.AddSupplementCommand(supplement, e.name)); }