示例#1
0
 public CardsForm(Them them, int sep)
 {
     InitializeComponent();
     this.them      = them;
     this.cards     = Desirialize().cards;
     this.forRepeat = new List <Card>();
     if (cards != null)
     {
         foreach (Card card in cards)
         {
             card.daysToRepeat -= sep;
             if (card.daysToRepeat < 0)
             {
                 card.daysToRepeat = 0;
             }
             if (card.daysToRepeat == 0)
             {
                 forRepeat.Add(card);
             }
             ListViewItem LVI = new ListViewItem(card.Name);
             LVI.Tag = card;
             cards_list.Items.Add(LVI);
             cards_list.Refresh();
         }
     }
 }
示例#2
0
 private void Add_Click(object sender, EventArgs e)
 {
     if (new_name.Text.Length > 0)
     {
         Them         them = new Them(new_name.Text);
         ListViewItem LVI  = new ListViewItem(them.name);
         LVI.Tag = them;
         listOfThems.Items.Add(LVI);
         new_name.Clear();
         File.Create("Cards_" + LVI.Text + ".xml").Close();
     }
     Save_Click(sender, e);
 }
示例#3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Them them     = (Them)listOfThems.SelectedItems[0].Tag;
            int  separate = 0;

            if (listOfThems.SelectedIndices.Count == 1)
            {
                if (!(them.DateTime.Equals(this.DateTime)))
                {
                    if (this.DateTime.Month < them.DateTime.Month)
                    {
                        separate = 0;
                    }
                    else
                    {
                        separate = this.DateTime.Day - them.DateTime.Day;
                    }
                }
                CardsForm cardsForm = new CardsForm(them, separate);
                ((Them)listOfThems.SelectedItems[0].Tag).DateTime = DateTime.Now;
                cardsForm.Show();
            }
        }
示例#4
0
 public Cards(Them them)
 {
     this.them  = them;
     this.cards = new List <Card>();
 }