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; }
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); }
public void Remove(Roller anItem) { int index = base.List.IndexOf(anItem); if (index >= 0) { this.Remove(index); } }
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); }
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); }
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); } }
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); } } }
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; }
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; }
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); } } } } } }
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); } }
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); }
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; }
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; }
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; }
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); } } } } } }
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); } }
public RollerItemEventArgs(Roller aItem) { this.m_Item = aItem; }
protected void DrawText(Graphics gr, Roller anItem, Rectangle aClientRect) { }