Exemplo n.º 1
0
 //updates bool array to write in json file
 private void UpdateToDoListFile()
 {
     Thread.Sleep(100);
     done = new bool[ClbItems.Items.Count];
     for (int i = 0; i < ClbItems.Items.Count; i++)
     {
         if (ClbItems.GetItemChecked(i))
         {
             done[i] = true;
         }
         else
         {
             done[i] = false;
         }
     }
     list = new List(title, items, done);
     UpdateListFile();
 }
Exemplo n.º 2
0
        //displays data from object properties
        private void DisplayListData()
        {
            this.Text = title;
            foreach (string item in items)
            {
                ClbItems.Items.Add(item);
                this.Height += ClbItems.GetItemRectangle(0).Height;
            }
            ClbItems.ClientSize = new Size(ClbItems.ClientSize.Width, ClbItems.GetItemRectangle(0).Height *ClbItems.Items.Count);

            if (done != null)
            {
                int i = 0;
                foreach (bool check in done)
                {
                    ClbItems.SetItemChecked(i, check);
                    i++;
                }
            }
        }