Exemplo n.º 1
0
        internal void InitDayRoller()
        {
            if (this.m_DayRoller == null)
            {
                this.m_DayRoller                = new Roller();
                this.m_DayRoller.Width          = 40;
                this.m_DayRoller.RollerDataType = RollerType.Day;
            }
            this.m_DayRoller.RowItems.Clear();
            bool anEnabled   = true;
            bool anIsDefault = false;
            int  day         = DateTime.Today.Day;

            for (int i = 1; i <= 0x1f; i++)
            {
                if (day == i)
                {
                    anIsDefault = true;
                }
                else
                {
                    anIsDefault = false;
                }
                if (i > this.m_MaxEnabledDay)
                {
                    anEnabled = false;
                }
                this.m_DayRoller.RowItems.Add(new DateTimePickerRow(i.ToString(), anEnabled, anIsDefault));
            }
            this.m_DayRoller.SelectedIndex = day - 1;
            this.m_DayRoller.Continues     = true;
        }
Exemplo n.º 2
0
        internal void InitMonthRoller()
        {
            if (this.m_MonthRoller == null)
            {
                this.m_MonthRoller                = new Roller();
                this.m_MonthRoller.Width          = 100;
                this.m_MonthRoller.RollerDataType = RollerType.Month;
            }
            this.m_MonthRoller.RowItems.Clear();
            bool anEnabled   = true;
            bool anIsDefault = false;
            int  num         = DateTime.Today.Month - 1;

            for (int i = 0; i < (DateTimeFormatInfo.CurrentInfo.MonthNames.Length - 1); i++)
            {
                string aText = DateTimeFormatInfo.CurrentInfo.MonthNames[i];
                if (num == i)
                {
                    anIsDefault = true;
                }
                else
                {
                    anIsDefault = false;
                }
                this.m_MonthRoller.RowItems.Add(new DateTimePickerRow(aText, anEnabled, anIsDefault));
            }
            this.m_MonthRoller.SelectedIndex         = num;
            this.m_MonthRoller.Continues             = true;
            this.m_MonthRoller.SelectedIndexChanged += new Roller.SelectedIndexChangedEventHandler(this.MonthRoller_SelectedIndexChanged);
        }
Exemplo n.º 3
0
 public void Remove(Roller anItem)
 {
     int index = base.List.IndexOf(anItem);
     if (index >= 0)
     {
         this.Remove(index);
     }
 }
Exemplo n.º 4
0
 public void Add(Roller anItem)
 {
     anItem.RefreshRequired += new RefreshRequiredEventHandler(this.RefreshToolbarItemRequired);
     if (this.m_Parent != null)
     {
         anItem.m_Parent = this.m_Parent;
     }
     base.List.Add(anItem);
 }
Exemplo n.º 5
0
 public void Insert(int index, Roller anItem)
 {
     anItem.RefreshRequired += new RefreshRequiredEventHandler(this.RefreshToolbarItemRequired);
     if (this.m_Parent != null)
     {
         anItem.m_Parent = this.m_Parent;
     }
     base.List.Insert(index, anItem);
 }
Exemplo n.º 6
0
        public void Remove(Roller anItem)
        {
            int index = base.List.IndexOf(anItem);

            if (index >= 0)
            {
                this.Remove(index);
            }
        }
Exemplo n.º 7
0
 public void Insert(int index, Roller anItem)
 {
     anItem.RefreshRequired += new RefreshRequiredEventHandler(this.RefreshToolbarItemRequired);
     if (this.m_Parent != null)
     {
         anItem.m_Parent = this.m_Parent;
     }
     base.List.Insert(index, anItem);
 }
Exemplo n.º 8
0
 public void Add(Roller anItem)
 {
     anItem.RefreshRequired += new RefreshRequiredEventHandler(this.RefreshToolbarItemRequired);
     if (this.m_Parent != null)
     {
         anItem.m_Parent = this.m_Parent;
     }
     base.List.Add(anItem);
 }
Exemplo n.º 9
0
        private void AdjustRollersByValue()
        {
            for (int i = 0; i < this.m_RollerItems.Count; i++)
            {
                int    num2;
                Roller roller = this.m_RollerItems[i];
                switch (roller.RollerDataType)
                {
                case RollerType.Year:
                {
                    roller.SetSelectedIndexWithoutInvalidate(this.m_Value.Year - this.MinDate.Year);
                    continue;
                }

                case RollerType.Month:
                {
                    roller.SetSelectedIndexWithoutInvalidate(this.m_Value.Month - 1);
                    continue;
                }

                case RollerType.Day:
                {
                    roller.SetSelectedIndexWithoutInvalidate(this.m_Value.Day - 1);
                    continue;
                }

                case RollerType.Hour:
                    if (!DateTimeFormatInfo.CurrentInfo.ShortTimePattern.StartsWith("h:"))
                    {
                        break;
                    }
                    num2 = this.GetSelectedIdxFor12hours();
                    goto Label_00B7;

                case RollerType.Minute:
                {
                    roller.SetSelectedIndexWithoutInvalidate(this.m_Value.Minute / this.m_MinuteInterval);
                    continue;
                }

                case RollerType.AmPm:
                {
                    roller.SetSelectedIndexWithoutInvalidate((this.m_Value.Hour < 12) ? 0 : 1);
                    continue;
                }

                default:
                {
                    continue;
                }
                }
                num2 = this.GetSelectedIdxFor24hours();
Label_00B7:
                roller.SetSelectedIndexWithoutInvalidate(num2);
            }
        }
Exemplo n.º 10
0
 private void DrawRollersText(Graphics gr, Color aColorDefaultText)
 {
     if ((this.m_RollerItems != null) && (this.m_RollerItems.Count != 0))
     {
         for (int i = 0; i < this.m_RollerItems.Count; i++)
         {
             Roller roller = this.m_RollerItems[i];
             this.DrawRoller(gr, roller, aColorDefaultText);
         }
     }
 }
Exemplo n.º 11
0
 public TouchTool(Roller aParent)
 {
     this.m_Parent = aParent;
     this.m_TouchScrollingTimer = new Timer();
     this.m_TouchScrollingTimer.Enabled = false;
     this.m_TouchScrollingTimer.Interval = 1;
     this.m_TouchScrollingTimer.Tick += new EventHandler(this.OnTouchScrollingTimerTick);
     this.m_bTouchScrolling = false;
     this.m_TouchAutoScrollDiffY = 0;
     this.m_TouchAutoScrollDiffX = 0;
     this.m_LeftRightGesture = false;
 }
Exemplo n.º 12
0
        internal void InitYearRoller()
        {
            if (this.m_YearRoller == null)
            {
                this.m_YearRoller                = new Roller();
                this.m_YearRoller.Width          = 60;
                this.m_YearRoller.RollerDataType = RollerType.Year;
            }
            this.m_YearRoller.RowItems.Clear();
            int year = DateTime.Today.Year;

            this.m_YearRoller.SelectedIndex = year - 0x76c;
        }
Exemplo n.º 13
0
        private void DrawRoller(Graphics gr, Roller roller, Color aColorDefaultText)
        {
            List <DateTimePickerRow> textFromTo = roller.GetTextFromTo(roller.SelectedIndex - 2, 6);
            StringFormat             format     = new StringFormat();

            format.Alignment     = StringAlignment.Center;
            format.LineAlignment = StringAlignment.Center;
            this.KRowHeight      = roller.RowHeight;
            int num = roller.ScrollbarOffset % this.KRowHeight;

            if (num > roller.RowHeight)
            {
                num = 0;
            }
            using (SolidBrush brush2 = new SolidBrush(aColorDefaultText))
            {
                using (SolidBrush brush3 = new SolidBrush(Color.Gray))
                {
                    using (SolidBrush brush4 = new SolidBrush(this.m_ColorActualItemForeColor))
                    {
                        for (int i = 0; i < textFromTo.Count; i++)
                        {
                            SolidBrush brush;
                            string     text            = textFromTo[i].Text;
                            Rectangle  layoutRectangle = new Rectangle(roller.ClientRectangle.X, ((roller.ClientRectangle.Y + roller.TextOffsetY) + (i * this.KRowHeight)) - num, roller.Width, this.KRowHeight);
                            if (textFromTo[i].Enabled)
                            {
                                if (textFromTo[i].IsDefault)
                                {
                                    brush = brush4;
                                }
                                else
                                {
                                    brush = brush2;
                                }
                            }
                            else
                            {
                                brush = brush3;
                            }
                            if (!string.Empty.Equals(text))
                            {
                                gr.DrawString(text, roller.TextFont, brush, layoutRectangle, format);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 14
0
        private void DrawVertical3DLines(Graphics gr, Roller roller)
        {
            float width  = 2f;
            int   num2   = roller.ClientRectangle.X + ((int)(width / 2f));
            int   y      = roller.ClientRectangle.Y;
            int   num4   = num2;
            int   bottom = roller.ClientRectangle.Bottom;

            using (Pen pen = new Pen(Color.Black, width))
            {
                gr.DrawLine(pen, num2, y, num4, bottom);
                num2 = roller.ClientRectangle.Right - ((int)(width / 2f));
                num4 = num2;
                gr.DrawLine(pen, num2, y, num4, bottom);
            }
        }
Exemplo n.º 15
0
 public void Remove(int anIndex)
 {
     if ((anIndex > (base.Count - 1)) || (anIndex < 0))
     {
         throw new IndexOutOfRangeException();
     }
     if ((base.List[anIndex] != null) && (base.List[anIndex] is Roller))
     {
         Roller roller = base.List[anIndex] as Roller;
         if (roller != null)
         {
             roller.RefreshRequired -= new RefreshRequiredEventHandler(this.RefreshToolbarItemRequired);
             roller.m_Parent         = null;
         }
     }
     base.List.RemoveAt(anIndex);
 }
Exemplo n.º 16
0
 internal void InitMinutesRoller()
 {
     if (this.m_MinuteRoller == null)
     {
         this.m_MinuteRoller                = new Roller();
         this.m_MinuteRoller.Width          = 50;
         this.m_MinuteRoller.RollerDataType = RollerType.Minute;
     }
     this.m_MinuteRoller.RowItems.Clear();
     for (int i = 0; i < 60; i += this.m_MinuteInterval)
     {
         string aText = string.Format("{0:00}", i);
         this.m_MinuteRoller.RowItems.Add(new DateTimePickerRow(aText));
     }
     this.m_MinuteRoller.SelectedIndex = DateTime.Now.Minute / this.m_MinuteInterval;
     this.m_MinuteRoller.Continues     = true;
 }
Exemplo n.º 17
0
        internal void InitHourRoller(string aStrTimePattern)
        {
            if (this.m_HourRoller == null)
            {
                this.m_HourRoller                = new Roller();
                this.m_HourRoller.Width          = 50;
                this.m_HourRoller.RollerDataType = RollerType.Hour;
            }
            this.m_HourRoller.RowItems.Clear();
            int num = aStrTimePattern.StartsWith("h") ? 12 : 0x17;

            this.m_FirstHour = (num == 12) ? 1 : 0;
            for (int i = this.m_FirstHour; i <= num; i++)
            {
                string aText = string.Format("{0:00}", i);
                this.m_HourRoller.RowItems.Add(new DateTimePickerRow(aText));
            }
            this.m_HourRoller.Continues = true;
            int num3 = (DateTime.Now.Hour > num) ? (DateTime.Now.Hour % num) : DateTime.Now.Hour;

            this.m_HourRoller.SelectedIndex = num3;
        }
Exemplo n.º 18
0
        internal void InitAmAndPmRoller()
        {
            if (this.m_AmAndPmRoller == null)
            {
                this.m_AmAndPmRoller                = new Roller();
                this.m_AmAndPmRoller.Width          = 50;
                this.m_AmAndPmRoller.RollerDataType = RollerType.AmPm;
            }
            this.m_AmAndPmRoller.RowItems.Clear();
            string aMDesignator = DateTimeFormatInfo.CurrentInfo.AMDesignator;
            string pMDesignator = DateTimeFormatInfo.CurrentInfo.PMDesignator;

            if ((aMDesignator == null) || (aMDesignator.Length == 0))
            {
                aMDesignator = "AM";
            }
            if ((pMDesignator == null) || (pMDesignator.Length == 0))
            {
                pMDesignator = "PM";
            }
            this.m_AmAndPmRoller.RowItems.Add(new DateTimePickerRow(aMDesignator));
            this.m_AmAndPmRoller.RowItems.Add(new DateTimePickerRow(pMDesignator));
            this.m_AmAndPmRoller.SelectedIndex = (DateTime.Now.Hour < 12) ? 0 : 1;
        }
Exemplo n.º 19
0
 private void DrawRoller(Graphics gr, Roller roller, Color aColorDefaultText)
 {
     List<DateTimePickerRow> textFromTo = roller.GetTextFromTo(roller.SelectedIndex - 2, 6);
     StringFormat format = new StringFormat();
     format.Alignment = StringAlignment.Center;
     format.LineAlignment = StringAlignment.Center;
     this.KRowHeight = roller.RowHeight;
     int num = roller.ScrollbarOffset % this.KRowHeight;
     if (num > roller.RowHeight)
     {
         num = 0;
     }
     using (SolidBrush brush2 = new SolidBrush(aColorDefaultText))
     {
         using (SolidBrush brush3 = new SolidBrush(Color.Gray))
         {
             using (SolidBrush brush4 = new SolidBrush(this.m_ColorActualItemForeColor))
             {
                 for (int i = 0; i < textFromTo.Count; i++)
                 {
                     SolidBrush brush;
                     string text = textFromTo[i].Text;
                     Rectangle layoutRectangle = new Rectangle(roller.ClientRectangle.X, ((roller.ClientRectangle.Y + roller.TextOffsetY) + (i * this.KRowHeight)) - num, roller.Width, this.KRowHeight);
                     if (textFromTo[i].Enabled)
                     {
                         if (textFromTo[i].IsDefault)
                         {
                             brush = brush4;
                         }
                         else
                         {
                             brush = brush2;
                         }
                     }
                     else
                     {
                         brush = brush3;
                     }
                     if (!string.Empty.Equals(text))
                     {
                         gr.DrawString(text, roller.TextFont, brush, layoutRectangle, format);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 20
0
 internal void InitAmAndPmRoller()
 {
     if (this.m_AmAndPmRoller == null)
     {
         this.m_AmAndPmRoller = new Roller();
         this.m_AmAndPmRoller.Width = 50;
         this.m_AmAndPmRoller.RollerDataType = RollerType.AmPm;
     }
     this.m_AmAndPmRoller.RowItems.Clear();
     string aMDesignator = DateTimeFormatInfo.CurrentInfo.AMDesignator;
     string pMDesignator = DateTimeFormatInfo.CurrentInfo.PMDesignator;
     if ((aMDesignator == null) || (aMDesignator.Length == 0))
     {
         aMDesignator = "AM";
     }
     if ((pMDesignator == null) || (pMDesignator.Length == 0))
     {
         pMDesignator = "PM";
     }
     this.m_AmAndPmRoller.RowItems.Add(new DateTimePickerRow(aMDesignator));
     this.m_AmAndPmRoller.RowItems.Add(new DateTimePickerRow(pMDesignator));
     this.m_AmAndPmRoller.SelectedIndex = (DateTime.Now.Hour < 12) ? 0 : 1;
 }
Exemplo n.º 21
0
 internal void InitDayRoller()
 {
     if (this.m_DayRoller == null)
     {
         this.m_DayRoller = new Roller();
         this.m_DayRoller.Width = 40;
         this.m_DayRoller.RollerDataType = RollerType.Day;
     }
     this.m_DayRoller.RowItems.Clear();
     bool anEnabled = true;
     bool anIsDefault = false;
     int day = DateTime.Today.Day;
     for (int i = 1; i <= 0x1f; i++)
     {
         if (day == i)
         {
             anIsDefault = true;
         }
         else
         {
             anIsDefault = false;
         }
         if (i > this.m_MaxEnabledDay)
         {
             anEnabled = false;
         }
         this.m_DayRoller.RowItems.Add(new DateTimePickerRow(i.ToString(), anEnabled, anIsDefault));
     }
     this.m_DayRoller.SelectedIndex = day - 1;
     this.m_DayRoller.Continues = true;
 }
Exemplo n.º 22
0
 internal void InitHourRoller(string aStrTimePattern)
 {
     if (this.m_HourRoller == null)
     {
         this.m_HourRoller = new Roller();
         this.m_HourRoller.Width = 50;
         this.m_HourRoller.RollerDataType = RollerType.Hour;
     }
     this.m_HourRoller.RowItems.Clear();
     int num = aStrTimePattern.StartsWith("h") ? 12 : 0x17;
     this.m_FirstHour = (num == 12) ? 1 : 0;
     for (int i = this.m_FirstHour; i <= num; i++)
     {
         string aText = string.Format("{0:00}", i);
         this.m_HourRoller.RowItems.Add(new DateTimePickerRow(aText));
     }
     this.m_HourRoller.Continues = true;
     int num3 = (DateTime.Now.Hour > num) ? (DateTime.Now.Hour % num) : DateTime.Now.Hour;
     this.m_HourRoller.SelectedIndex = num3;
 }
Exemplo n.º 23
0
 internal void InitMinutesRoller()
 {
     if (this.m_MinuteRoller == null)
     {
         this.m_MinuteRoller = new Roller();
         this.m_MinuteRoller.Width = 50;
         this.m_MinuteRoller.RollerDataType = RollerType.Minute;
     }
     this.m_MinuteRoller.RowItems.Clear();
     for (int i = 0; i < 60; i += this.m_MinuteInterval)
     {
         string aText = string.Format("{0:00}", i);
         this.m_MinuteRoller.RowItems.Add(new DateTimePickerRow(aText));
     }
     this.m_MinuteRoller.SelectedIndex = DateTime.Now.Minute / this.m_MinuteInterval;
     this.m_MinuteRoller.Continues = true;
 }
Exemplo n.º 24
0
 internal void InitMonthRoller()
 {
     if (this.m_MonthRoller == null)
     {
         this.m_MonthRoller = new Roller();
         this.m_MonthRoller.Width = 100;
         this.m_MonthRoller.RollerDataType = RollerType.Month;
     }
     this.m_MonthRoller.RowItems.Clear();
     bool anEnabled = true;
     bool anIsDefault = false;
     int num = DateTime.Today.Month - 1;
     for (int i = 0; i < (DateTimeFormatInfo.CurrentInfo.MonthNames.Length - 1); i++)
     {
         string aText = DateTimeFormatInfo.CurrentInfo.MonthNames[i];
         if (num == i)
         {
             anIsDefault = true;
         }
         else
         {
             anIsDefault = false;
         }
         this.m_MonthRoller.RowItems.Add(new DateTimePickerRow(aText, anEnabled, anIsDefault));
     }
     this.m_MonthRoller.SelectedIndex = num;
     this.m_MonthRoller.Continues = true;
     this.m_MonthRoller.SelectedIndexChanged += new Roller.SelectedIndexChangedEventHandler(this.MonthRoller_SelectedIndexChanged);
 }
Exemplo n.º 25
0
 private void DrawVertical3DLines(Graphics gr, Roller roller)
 {
     float width = 2f;
     int num2 = roller.ClientRectangle.X + ((int) (width / 2f));
     int y = roller.ClientRectangle.Y;
     int num4 = num2;
     int bottom = roller.ClientRectangle.Bottom;
     using (Pen pen = new Pen(Color.Black, width))
     {
         gr.DrawLine(pen, num2, y, num4, bottom);
         num2 = roller.ClientRectangle.Right - ((int) (width / 2f));
         num4 = num2;
         gr.DrawLine(pen, num2, y, num4, bottom);
     }
 }
Exemplo n.º 26
0
 internal void InitYearRoller()
 {
     if (this.m_YearRoller == null)
     {
         this.m_YearRoller = new Roller();
         this.m_YearRoller.Width = 60;
         this.m_YearRoller.RollerDataType = RollerType.Year;
     }
     this.m_YearRoller.RowItems.Clear();
     int year = DateTime.Today.Year;
     this.m_YearRoller.SelectedIndex = year - 0x76c;
 }
Exemplo n.º 27
0
 public RollerItemEventArgs(Roller aItem)
 {
     this.m_Item = aItem;
 }
Exemplo n.º 28
0
 protected void DrawText(Graphics gr, Roller anItem, Rectangle aClientRect)
 {
 }
Exemplo n.º 29
0
 public RollerItemEventArgs(Roller aItem)
 {
     this.m_Item = aItem;
 }
Exemplo n.º 30
0
 protected void DrawText(Graphics gr, Roller anItem, Rectangle aClientRect)
 {
 }