Example #1
0
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs pe)
        {
            var graphics = pe.Graphics;

            graphics.Clear(this.BackColor);

            Image temp_Image = null;

            Job.Status status = job.get_Status(DateTime.Now);
            switch (status)
            {
            case Job.Status.Beyond_The_Limit:
                temp_Image = Form_Reminder.white_Border;
                break;

            case Job.Status.End:
                temp_Image = Form_Reminder.red_Border;
                break;

            case Job.Status.Middle:
                temp_Image = Form_Reminder.pink_Border;
                break;

            case Job.Status.Start:
                temp_Image = Form_Reminder.green_Border;
                break;
            }
            graphics.DrawImage(temp_Image, 0, 0, this.Width, this.Height);
            //graphics.DrawImage(image, 2*border_In_Horizontal, 2*border_In_Vertical, this.Width-(4*border_In_Horizontal), (Convert.ToInt32(this.Height * 0.6))-(2*border_In_Vertical));
            graphics.DrawImage(image, 2 * border_In_Horizontal, 2 * border_In_Vertical, this.Width - (4 * border_In_Horizontal), (Convert.ToInt32(this.Height * 0.6)) - (2 * border_In_Vertical));

            System.Drawing.SolidBrush   solid_Brush = new SolidBrush(string_Color);
            System.Drawing.Font         temp_Font   = new System.Drawing.Font("Verdana", 8, FontStyle.Bold);
            System.Drawing.SizeF        temp_Size   = graphics.MeasureString(job.subject, temp_Font);
            System.Drawing.StringFormat temp_Format = new System.Drawing.StringFormat();
            temp_Format.FormatFlags = StringFormatFlags.LineLimit;
            temp_Format.Alignment   = System.Drawing.StringAlignment.Center;
            System.Drawing.RectangleF temp_Rectangle = new System.Drawing.RectangleF(border_In_Horizontal, (float)(this.Height * 0.6) + border_In_Vertical, (float)this.Width - (2 * border_In_Horizontal), (float)(this.Height * 0.4) - (2 * border_In_Vertical));

            graphics.DrawString(job.subject, temp_Font, solid_Brush, temp_Rectangle, temp_Format);
        }
Example #2
0
 public async Task UpdateJobUnitUI(string identifier, Job.JobUnit jobUnit, Job.Status status)
 => await jobUnitCallback(identifier, jobUnit, status);
Example #3
0
 public async Task UpdateJobUI(string identifier, Job.Status status)
 => await callback(identifier, status);