Example #1
0
        public override bool Equals(object obj)
        {
            CustomAppointment appointment = obj as CustomAppointment;

            if (appointment == null)
            {
                return(false);
            }
            if (!this.Title.Equals(appointment.Title))
            {
                return(false);
            }
            if (!this.Start.Equals(appointment.Start))
            {
                return(false);
            }
            if (!this.End.Equals(appointment.End))
            {
                return(false);
            }
            if ((this.Tag != null) && !this.Tag.Equals(appointment.Tag))
            {
                return(false);
            }
            if (!this.GetHashCode().Equals(appointment.GetHashCode()))
            {
                return(false);
            }
            return(true);
        }
Example #2
0
        public Rectangle DrawGripper(Graphics g, Rectangle rect, CustomAppointment appointment, bool isSelected, int gripWidth, int hourLines, int halfHourHeight)
        {
            DrawEventArgs e = new DrawEventArgs(g, rect, appointment, isSelected, gripWidth);

            if (base.OnResolveDrawGripper(e))
            {
                return(rect);
            }
            Rectangle rc = CalculateGripRect(rect, appointment, hourLines, halfHourHeight);

            rc.Width = gripWidth + 1;
            if (base.m_useGradient)
            {
                if (appointment.GradientBackColor == null)
                {
                    new GradientColor(GradientFill.GetColorLighter(appointment.BorderColor), GradientFill.GetColorDarker(appointment.BorderColor), FillDirection.Vertical).DrawGradient(g, rc);
                    return(rc);
                }
                appointment.GradientBackColor.DrawGradient(g, rc);
                return(rc);
            }
            using (SolidBrush brush = new SolidBrush(appointment.BorderColor))
            {
                g.FillRectangle(brush, rc);
            }
            return(rc);
        }
Example #3
0
 public DrawEventArgs(System.Drawing.Graphics aGraphics, Rectangle aRect, CustomAppointment anAppointment, bool anIsSelected, int aGripWidth)
 {
     this.m_Graphics    = aGraphics;
     this.m_Rect        = aRect;
     this.m_Appointment = anAppointment;
     this.m_IsSelected  = anIsSelected;
     this.m_GripWidth   = aGripWidth;
 }
Example #4
0
 public DrawEventArgs(System.Drawing.Graphics aGraphics, Rectangle aRect, CustomAppointment anAppointment, bool anIsSelected, int aGripWidth)
 {
     this.m_Graphics = aGraphics;
     this.m_Rect = aRect;
     this.m_Appointment = anAppointment;
     this.m_IsSelected = anIsSelected;
     this.m_GripWidth = aGripWidth;
 }
Example #5
0
 public CustomAppointment(CustomAppointment anAppointment)
 {
     this.m_color = System.Drawing.Color.White;
     this.m_TextColor = System.Drawing.Color.Black;
     this.m_BorderColor = System.Drawing.Color.Blue;
     this.m_Title = "New Appointment";
     this.m_ToolTip = string.Empty;
     foreach (PropertyInfo info in Type.GetType("Resco.Controls.OutlookControls.CustomAppointment").GetProperties())
     {
         MethodInfo getMethod = info.GetGetMethod();
         MethodInfo setMethod = info.GetSetMethod();
         object obj2 = getMethod.Invoke(anAppointment, null);
         object[] parameters = new object[] { obj2 };
         setMethod.Invoke(this, parameters);
     }
 }
Example #6
0
 public CustomAppointment(CustomAppointment anAppointment)
 {
     this.m_color       = System.Drawing.Color.White;
     this.m_TextColor   = System.Drawing.Color.Black;
     this.m_BorderColor = System.Drawing.Color.Blue;
     this.m_Title       = "New Appointment";
     this.m_ToolTip     = string.Empty;
     foreach (PropertyInfo info in Type.GetType("Resco.Controls.OutlookControls.CustomAppointment").GetProperties())
     {
         MethodInfo getMethod  = info.GetGetMethod();
         MethodInfo setMethod  = info.GetSetMethod();
         object     obj2       = getMethod.Invoke(anAppointment, null);
         object[]   parameters = new object[] { obj2 };
         setMethod.Invoke(this, parameters);
     }
 }
Example #7
0
 public static Rectangle CalculateGripRect(Rectangle rect, CustomAppointment appointment, int hourLines, int halfHourHeight)
 {
     Rectangle rectangle = rect;
     rectangle.Y++;
     rectangle.Height--;
     int num = 60 / hourLines;
     double num2 = ((double) halfHourHeight) / ((double) num);
     if (appointment.StartDate.Minute != 0)
     {
         int num3 = (int) ((appointment.StartDate.Minute % num) * num2);
         rectangle.Y += num3;
         rectangle.Height -= num3;
     }
     if ((appointment.EndDate.Minute != 0) && ((appointment.EndDate.Minute % num) > 0))
     {
         rectangle.Height -= (int) ((num - (appointment.EndDate.Minute % num)) * num2);
     }
     return rectangle;
 }
Example #8
0
        public override void DrawAllDayAppointment(Graphics gr, CustomAppointment app, ref Rectangle borderRect, bool anIsSelected)
        {
            float width = 1f;
            Color black = Color.Black;

            using (SolidBrush brush = new SolidBrush(app.BorderColor))
            {
                gr.FillRectangle(brush, borderRect);
            }
            if (anIsSelected)
            {
                width = 2f;
                black = this.SelectionColor;
                borderRect.Inflate(-1, -1);
            }
            using (Pen pen = new Pen(black, width))
            {
                gr.DrawRectangle(pen, borderRect);
            }
        }
Example #9
0
 public static Rectangle DrawIcons(Graphics gr, Rectangle aTextRect, CustomAppointment anAppointment, ImageList anAppIcons)
 {
     if ((anAppIcons != null) && (anAppointment.IconIndexes != null))
     {
         int length = anAppointment.IconIndexes.Length;
         int width = anAppIcons.ImageSize.Width;
         int num3 = aTextRect.Width / 3;
         if ((aTextRect.Width / 2) > width)
         {
             int x = (aTextRect.Right - 1) - width;
             int y = aTextRect.Y + 1;
             Region clip = gr.Clip;
             Region region2 = new Region(aTextRect);
             region2.Intersect(clip);
             gr.Clip = region2;
             for (int i = length - 1; i >= 0; i--)
             {
                 using (Image image = anAppIcons.Images[anAppointment.IconIndexes[i]])
                 {
                     Rectangle rect = new Rectangle(x, y, width, width);
                     DrawSingleIcon(gr, rect, image);
                 }
                 x -= width;
                 if (num3 >= (x - aTextRect.X))
                 {
                     aTextRect.Width -= width * (length - i);
                     return aTextRect;
                 }
             }
             gr.ResetClip();
             region2.Dispose();
             region2 = null;
             if (clip != null)
             {
                 gr.Clip = clip;
             }
             aTextRect.Width -= width * length;
         }
     }
     return aTextRect;
 }
Example #10
0
 public static Rectangle DrawIcons(Graphics gr, Rectangle aTextRect, CustomAppointment anAppointment, ImageList anAppIcons)
 {
     if ((anAppIcons != null) && (anAppointment.IconIndexes != null))
     {
         int length = anAppointment.IconIndexes.Length;
         int width  = anAppIcons.ImageSize.Width;
         int num3   = aTextRect.Width / 3;
         if ((aTextRect.Width / 2) > width)
         {
             int    x       = (aTextRect.Right - 1) - width;
             int    y       = aTextRect.Y + 1;
             Region clip    = gr.Clip;
             Region region2 = new Region(aTextRect);
             region2.Intersect(clip);
             gr.Clip = region2;
             for (int i = length - 1; i >= 0; i--)
             {
                 using (Image image = anAppIcons.Images[anAppointment.IconIndexes[i]])
                 {
                     Rectangle rect = new Rectangle(x, y, width, width);
                     DrawSingleIcon(gr, rect, image);
                 }
                 x -= width;
                 if (num3 >= (x - aTextRect.X))
                 {
                     aTextRect.Width -= width * (length - i);
                     return(aTextRect);
                 }
             }
             gr.ResetClip();
             region2.Dispose();
             region2 = null;
             if (clip != null)
             {
                 gr.Clip = clip;
             }
             aTextRect.Width -= width * length;
         }
     }
     return(aTextRect);
 }
Example #11
0
        public static Rectangle CalculateGripRect(Rectangle rect, CustomAppointment appointment, int hourLines, int halfHourHeight)
        {
            Rectangle rectangle = rect;

            rectangle.Y++;
            rectangle.Height--;
            int    num  = 60 / hourLines;
            double num2 = ((double)halfHourHeight) / ((double)num);

            if (appointment.StartDate.Minute != 0)
            {
                int num3 = (int)((appointment.StartDate.Minute % num) * num2);
                rectangle.Y      += num3;
                rectangle.Height -= num3;
            }
            if ((appointment.EndDate.Minute != 0) && ((appointment.EndDate.Minute % num) > 0))
            {
                rectangle.Height -= (int)((num - (appointment.EndDate.Minute % num)) * num2);
            }
            return(rectangle);
        }
Example #12
0
 public override void DrawAllDayAppointment(Graphics gr, CustomAppointment app, ref Rectangle borderRect, bool anIsSelected)
 {
     float width = 1f;
     Color black = Color.Black;
     using (SolidBrush brush = new SolidBrush(app.BorderColor))
     {
         gr.FillRectangle(brush, borderRect);
     }
     if (anIsSelected)
     {
         width = 2f;
         black = this.SelectionColor;
         borderRect.Inflate(-1, -1);
     }
     using (Pen pen = new Pen(black, width))
     {
         gr.DrawRectangle(pen, borderRect);
     }
 }
Example #13
0
 public Rectangle DrawGripper(Graphics g, Rectangle rect, CustomAppointment appointment, bool isSelected, int gripWidth, int hourLines, int halfHourHeight)
 {
     DrawEventArgs e = new DrawEventArgs(g, rect, appointment, isSelected, gripWidth);
     if (base.OnResolveDrawGripper(e))
     {
         return rect;
     }
     Rectangle rc = CalculateGripRect(rect, appointment, hourLines, halfHourHeight);
     rc.Width = gripWidth + 1;
     if (base.m_useGradient)
     {
         if (appointment.GradientBackColor == null)
         {
             new GradientColor(GradientFill.GetColorLighter(appointment.BorderColor), GradientFill.GetColorDarker(appointment.BorderColor), FillDirection.Vertical).DrawGradient(g, rc);
             return rc;
         }
         appointment.GradientBackColor.DrawGradient(g, rc);
         return rc;
     }
     using (SolidBrush brush = new SolidBrush(appointment.BorderColor))
     {
         g.FillRectangle(brush, rc);
     }
     return rc;
 }
Example #14
0
 public override void DrawAppointment(Graphics g, Rectangle rect, CustomAppointment appointment, bool isSelected, int gripWidth, int hourLines, int halfHourHeight)
 {
     DrawEventArgs e = new DrawEventArgs(g, rect, appointment, isSelected, gripWidth);
     if (!base.OnResolveDrawAppointment(e))
     {
         Pen pen = new Pen(SystemColors.WindowFrame, 1f);
         if (rect.Width <= base.AppointmentMinimalWidth)
         {
             Rectangle rectangle = this.DrawGripper(g, rect, appointment, isSelected, rect.Width, hourLines, halfHourHeight);
             g.DrawRectangle(pen, rectangle);
             if (isSelected)
             {
                 Rectangle rectangle2 = rectangle;
                 rectangle2.Inflate(-2, -2);
                 using (Pen pen2 = new Pen(this.SelectionColor, 2f))
                 {
                     g.DrawRectangle(pen2, rectangle2);
                 }
                 g.DrawRectangle(pen, rectangle2);
             }
             pen.Dispose();
             pen = null;
         }
         else
         {
             StringFormat format = new StringFormat();
             format.Alignment = StringAlignment.Near;
             format.LineAlignment = StringAlignment.Near;
             Rectangle rectangle3 = rect;
             rectangle3.X += gripWidth + 2;
             rectangle3.Width -= gripWidth + 1;
             using (SolidBrush brush = new SolidBrush(appointment.Color))
             {
                 g.FillRectangle(brush, rectangle3);
             }
             Rectangle rectangle4 = this.DrawGripper(g, rect, appointment, isSelected, gripWidth, hourLines, halfHourHeight);
             g.DrawRectangle(pen, rectangle4);
             Rectangle aTextRect = rectangle3;
             aTextRect.Inflate(-2, -2);
             Rectangle layoutRectangle = DrawIcons(g, aTextRect, appointment, base.AppIcons);
             using (SolidBrush brush2 = new SolidBrush(appointment.TextColor))
             {
                 g.DrawString(appointment.Title, this.FontBase, brush2, layoutRectangle, format);
             }
             DrawToolTipArrowIfNeeded(g, appointment.Title, this.FontBase, layoutRectangle, rectangle3, halfHourHeight);
             if (isSelected)
             {
                 Rectangle rectangle7 = rect;
                 rectangle7.Inflate(-2, -2);
                 using (Pen pen3 = new Pen(appointment.BorderColor, 4f))
                 {
                     g.DrawRectangle(pen3, rectangle7);
                 }
                 rectangle7.Inflate(2, 2);
                 g.DrawRectangle(pen, rectangle7);
                 rectangle7.Inflate(-4, -4);
                 g.DrawRectangle(pen, rectangle7);
             }
             else
             {
                 using (Pen pen4 = new Pen(SystemColors.InactiveBorder, 1f))
                 {
                     g.DrawRectangle(pen4, rectangle3);
                 }
             }
             pen.Dispose();
             pen = null;
         }
     }
 }
Example #15
0
 public abstract void DrawAppointment(Graphics g, Rectangle rect, CustomAppointment appointment, bool isSelected, int gripWidth, int hourLines, int halfHourHeight);
Example #16
0
 public abstract void DrawAllDayAppointment(Graphics gr, CustomAppointment app, ref Rectangle borderRect, bool anIsSelected);
Example #17
0
        public override void DrawAppointment(Graphics g, Rectangle rect, CustomAppointment appointment, bool isSelected, int gripWidth, int hourLines, int halfHourHeight)
        {
            DrawEventArgs e = new DrawEventArgs(g, rect, appointment, isSelected, gripWidth);

            if (!base.OnResolveDrawAppointment(e))
            {
                Pen pen = new Pen(SystemColors.WindowFrame, 1f);
                if (rect.Width <= base.AppointmentMinimalWidth)
                {
                    Rectangle rectangle = this.DrawGripper(g, rect, appointment, isSelected, rect.Width, hourLines, halfHourHeight);
                    g.DrawRectangle(pen, rectangle);
                    if (isSelected)
                    {
                        Rectangle rectangle2 = rectangle;
                        rectangle2.Inflate(-2, -2);
                        using (Pen pen2 = new Pen(this.SelectionColor, 2f))
                        {
                            g.DrawRectangle(pen2, rectangle2);
                        }
                        g.DrawRectangle(pen, rectangle2);
                    }
                    pen.Dispose();
                    pen = null;
                }
                else
                {
                    StringFormat format = new StringFormat();
                    format.Alignment     = StringAlignment.Near;
                    format.LineAlignment = StringAlignment.Near;
                    Rectangle rectangle3 = rect;
                    rectangle3.X     += gripWidth + 2;
                    rectangle3.Width -= gripWidth + 1;
                    using (SolidBrush brush = new SolidBrush(appointment.Color))
                    {
                        g.FillRectangle(brush, rectangle3);
                    }
                    Rectangle rectangle4 = this.DrawGripper(g, rect, appointment, isSelected, gripWidth, hourLines, halfHourHeight);
                    g.DrawRectangle(pen, rectangle4);
                    Rectangle aTextRect = rectangle3;
                    aTextRect.Inflate(-2, -2);
                    Rectangle layoutRectangle = DrawIcons(g, aTextRect, appointment, base.AppIcons);
                    using (SolidBrush brush2 = new SolidBrush(appointment.TextColor))
                    {
                        g.DrawString(appointment.Title, this.FontBase, brush2, layoutRectangle, format);
                    }
                    DrawToolTipArrowIfNeeded(g, appointment.Title, this.FontBase, layoutRectangle, rectangle3, halfHourHeight);
                    if (isSelected)
                    {
                        Rectangle rectangle7 = rect;
                        rectangle7.Inflate(-2, -2);
                        using (Pen pen3 = new Pen(appointment.BorderColor, 4f))
                        {
                            g.DrawRectangle(pen3, rectangle7);
                        }
                        rectangle7.Inflate(2, 2);
                        g.DrawRectangle(pen, rectangle7);
                        rectangle7.Inflate(-4, -4);
                        g.DrawRectangle(pen, rectangle7);
                    }
                    else
                    {
                        using (Pen pen4 = new Pen(SystemColors.InactiveBorder, 1f))
                        {
                            g.DrawRectangle(pen4, rectangle3);
                        }
                    }
                    pen.Dispose();
                    pen = null;
                }
            }
        }
Example #18
0
 public abstract void DrawAllDayAppointment(Graphics gr, CustomAppointment app, ref Rectangle borderRect, bool anIsSelected);
Example #19
0
 public abstract void DrawAppointment(Graphics g, Rectangle rect, CustomAppointment appointment, bool isSelected, int gripWidth, int hourLines, int halfHourHeight);