Example #1
0
        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);
                    }
                }
            }
        }
Example #2
0
 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
 }
Example #3
0
 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);
     }
 }
Example #6
0
 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;
 }
Example #7
0
 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;
         }
     }
 }
Example #8
0
 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);
     }
 }
Example #9
0
 private void OnSuppNameChanged(object sender, TStringArgs e)
 {
     supplement[suppIdx].sName = e.name;
 }
Example #10
0
 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;
         }
     }
 }
Example #11
0
 private void OnSuppNameChanged(object sender, TStringArgs e)
 {
     supplement[suppIdx].sName = e.name;
 }
Example #12
0
 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
 }
Example #13
0
 private void OnSuppNameChanged(object sender, TStringArgs e)
 {
     supplement[suppIdx].sName = e.name;
     this.supplementView.SelectedSupplementName = e.name;
 }
Example #14
0
 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);
         }
     }
 }
Example #15
0
 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;
 }
Example #16
0
 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;
 }
Example #17
0
 /// <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));
 }
Example #18
0
 /// <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));
 }
Example #19
0
 private void OnSuppNameChanged(object sender, TStringArgs e)
 {
     supplement[suppIdx].sName = e.name;
     this.supplementView.SelectedSupplementName = e.name;
 }