コード例 #1
0
        protected virtual void DrawDigit(System.Drawing.Graphics graphics, DateTapeViewInfo dateViewInfo, Rectangle rect, DateInfoType datePart)
        {
            Array positions = Enum.GetValues(typeof(PositionType));

            foreach (PositionType positionType in positions)
            {
                Rectangle    dateRect       = dateViewInfo.GetRect(rect, positionType);
                DateTapeEdit edit           = dateViewInfo.OwnerEdit as DateTapeEdit;
                bool         isSelectedPart = edit != null && edit.SelectedDatePart == datePart;
                if (isSelectedPart && positionType != PositionType.Middle)
                {
                    using (Brush br = GetSelectedBackBrush())
                        graphics.FillRectangle(br, dateRect);
                }

                RepositoryItemDateTapeEdit item = dateViewInfo.Item as RepositoryItemDateTapeEdit;
                DateTime dt       = Convert.ToDateTime(dateViewInfo.EditValue);
                string   dayValue = item.GetDayValueByPosition(datePart, positionType, dt).ToString();
                using (Brush br = GetForeBrush(positionType, isSelectedPart))
                    graphics.DrawString(dayValue, dateViewInfo.PaintAppearance.Font, br, dateRect);
            }
        }
コード例 #2
0
 static DateTapeEdit()
 {
     RepositoryItemDateTapeEdit.RegisterCustomEdit();
 }