Esempio n. 1
0
        //public Savement(string message) : base(message) { }
        //public Savement(string message, System.Exception inner) : base(message, inner) { }
        //protected Savement(SerializationInfo info, StreamingContext context) : base(info, context) {} // allways got this ctor from Serialization!!! problem!!

        public Savement(Form1 mf, bool showAddNewSavement = false)
        {
            mainForm     = mf;
            datetime     = DateTime.Now;
            save         = initButtons(save, TYPES.SAVE);
            load         = initButtons(load, TYPES.LOAD);
            reset        = initButtons(reset, TYPES.RESET);
            date         = initLables(date, TYPES.DATE);
            time         = initLables(time, TYPES.TIME);
            numberLbl    = initLables(numberLbl, TYPES.NUMBER);
            panel        = initPanel(panel);
            nameSavement = initTextBoxes(nameSavement);
            countSavements++;
            number = countSavements;
            addControlsToPanel();

            ShowMessage = initMessage(ShowMessage, MESSAGE);
            if (showAddNewSavement)
            {
                deleted = true;
                removeControlsFromPanel();
                panel.Controls.Add(ShowMessage);
                ShowMessage.BringToFront();
                nameSavement.Text = "שמירה חדשה";
                if (ListSavementsPanel != null)
                {
                    ListSavementsPanel.updateList();
                }
            }
        }
Esempio n. 2
0
 public void resetData(object sender, EventArgs e)
 {
     Bunifu.Framework.UI.BunifuThinButton2 btn = sender as Bunifu.Framework.UI.BunifuThinButton2;
     if (btn == reset)
     {
         System.Windows.Forms.DialogResult result = System.Windows.Forms.MessageBox.Show("האם אתה בטוח שאתה רוצה למחוק את השמירה הזאת?", "מחיקת שמירה", System.Windows.Forms.MessageBoxButtons.YesNo);
         if (result == System.Windows.Forms.DialogResult.Yes)
         {
             deleted = true;
             removeControlsFromPanel();
             panel.Controls.Add(ShowMessage);
             ShowMessage.BringToFront();
             nameSavement.Text = "שמירה חדשה";
             if (ListSavementsPanel != null)
             {
                 ListSavementsPanel.updateList();
             }
         }
     }
 }