コード例 #1
0
        void DisplayTimeEntryList(bool open, List <KopsikApi.KopsikTimeEntryViewItem> list)
        {
            if (InvokeRequired)
            {
                Invoke((MethodInvoker) delegate { DisplayTimeEntryList(open, list); });
                return;
            }
            int y = 0;

            this.panelContent.Controls.Clear();
            foreach (KopsikApi.KopsikTimeEntryViewItem item in list)
            {
                if (item.IsHeader)
                {
                    TimeEntryCellWithHeader cell = new TimeEntryCellWithHeader(y);
                    cell.Setup(item);
                    this.panelContent.Controls.Add(cell);
                    y += 82;
                }
                else
                {
                    TimeEntryCell cell = new TimeEntryCell(y);
                    cell.Setup(item);
                    this.panelContent.Controls.Add(cell);
                    y += 49;
                }
            }
        }
コード例 #2
0
 void DisplayTimeEntryList(bool open, List<KopsikApi.KopsikTimeEntryViewItem> list)
 {
     if (InvokeRequired)
     {
         Invoke((MethodInvoker)delegate { DisplayTimeEntryList(open, list); });
         return;
     }
     int y = 0;
     this.panelContent.Controls.Clear();
     foreach (KopsikApi.KopsikTimeEntryViewItem item in list)
     {
         if (item.IsHeader)
         {
             TimeEntryCellWithHeader cell = new TimeEntryCellWithHeader(y);
             cell.Setup(item);
             this.panelContent.Controls.Add(cell);
             y += 82;
         }
         else
         {
             TimeEntryCell cell = new TimeEntryCell(y);
             cell.Setup(item);
             this.panelContent.Controls.Add(cell);
             y += 49;
         }
     }
 }
コード例 #3
0
        void DisplayTimeEntryList(bool open, List <KopsikApi.KopsikTimeEntryViewItem> list)
        {
            if (InvokeRequired)
            {
                Invoke((MethodInvoker) delegate { DisplayTimeEntryList(open, list); });
                return;
            }
            this.Dock = DockStyle.Fill;
            int y = 0;

            this.EntriesList.Controls.Clear();
            foreach (KopsikApi.KopsikTimeEntryViewItem item in list)
            {
                if (item.IsHeader)
                {
                    TimeEntryCellWithHeader cell = new TimeEntryCellWithHeader(y, this.Width);
                    cell.Setup(item);
                    this.EntriesList.Controls.Add(cell);
                    y += (cell.Height + 1);
                }
                else
                {
                    TimeEntryCell cell = new TimeEntryCell(y, this.Width);
                    cell.Setup(item);
                    this.EntriesList.Controls.Add(cell);
                    y += (cell.Height + 1);
                }
            }
        }
コード例 #4
0
        void OnTimeEntryList(bool open, List<Toggl.TimeEntry> list)
        {
            if (InvokeRequired)
            {
                Invoke((MethodInvoker)delegate { OnTimeEntryList(open, list); });
                return;
            }
            DateTime start = DateTime.Now;

            int y = 0;

            List<Control> controls = new List<Control>();

            foreach (Toggl.TimeEntry item in list)
            {
                if (item.IsHeader)
                {
                    TimeEntryCellWithHeader cell = new TimeEntryCellWithHeader(y, Width);
                    cell.Setup(item);
                    controls.Add(cell);
                    y += cell.Height;
                }
                else
                {
                    TimeEntryCell cell = new TimeEntryCell(y, Width);
                    cell.Setup(item);
                    controls.Add(cell);
                    y += cell.Height;
                }

            }

            Dock = DockStyle.Fill;
            EntriesList.SuspendLayout();
            EntriesList.Controls.Clear();
            EntriesList.Controls.AddRange(controls.ToArray());
            EntriesList.ResumeLayout(false);
            EntriesList.PerformLayout();

            TimeSpan spent = DateTime.Now.Subtract(start);
            Console.WriteLine(String.Format(
                "Time entries list view rendered in {0} ms",
                spent.TotalMilliseconds));
        }
コード例 #5
0
 internal void DrawEntriesList(List<KopsikApi.KopsikTimeEntryViewItem> list)
 {
     int y = 0;
     this.panelContent.Controls.Clear();
     foreach (KopsikApi.KopsikTimeEntryViewItem item in list)
     {
         if (item.IsHeader)
         {
             TimeEntryCellWithHeader cell = new TimeEntryCellWithHeader(y);
             cell.Setup(item);
             this.panelContent.Controls.Add(cell);
             y += 82;
         }
         else
         {
             TimeEntryCell cell = new TimeEntryCell(y);
             cell.Setup(item);
             this.panelContent.Controls.Add(cell);
             y += 49;
         }
     }
 }
コード例 #6
0
        internal void DrawEntriesList(List <KopsikApi.KopsikTimeEntryViewItem> list)
        {
            int y = 0;

            this.panelContent.Controls.Clear();
            foreach (KopsikApi.KopsikTimeEntryViewItem item in list)
            {
                if (item.IsHeader)
                {
                    TimeEntryCellWithHeader cell = new TimeEntryCellWithHeader(y);
                    cell.Setup(item);
                    this.panelContent.Controls.Add(cell);
                    y += 82;
                }
                else
                {
                    TimeEntryCell cell = new TimeEntryCell(y);
                    cell.Setup(item);
                    this.panelContent.Controls.Add(cell);
                    y += 49;
                }
            }
        }