Exemple #1
0
        public void DatePickerConstructorWithDatePickerStyle()
        {
            tlog.Debug(tag, $"DatePickerConstructorWithDatePickerStyle START");

            DatePickerStyle dpStyle = new DatePickerStyle()
            {
                Pickers = new PickerStyle()
                {
                    StartScrollOffset = new Size(10, 10),
                    Divider           = new ViewStyle()
                    {
                        Position = new Position(30, 40),
                    }
                },
                CellPadding = new Size2D(20, 20),
            };

            var testingTarget = new DatePicker(dpStyle);

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <DatePicker>(testingTarget, "Should return DatePicker instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"DatePickerConstructorWithDatePickerStyle END (OK)");
        }
Exemple #2
0
        public void DatePickerGetNextFocusableView()
        {
            tlog.Debug(tag, $"DatePickerGetNextFocusableView START");

            DatePickerStyle dpStyle = new DatePickerStyle()
            {
                Pickers = new PickerStyle()
                {
                    StartScrollOffset = new Size(10, 10),
                    Divider           = new ViewStyle()
                    {
                        Position = new Position(30, 40),
                    }
                },
                CellPadding = new Size2D(20, 20),
            };

            var testingTarget = new DatePicker(dpStyle);

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <DatePicker>(testingTarget, "Should return DatePicker instance.");

            try
            {
                testingTarget.GetNextFocusableView(null, View.FocusDirection.Down, true);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            tlog.Debug(tag, $"DatePickerGetNextFocusableView END (OK)");
        }
Exemple #3
0
        public void DatePickerStyleCopyFrom()
        {
            tlog.Debug(tag, $"DatePickerStyleCopyFrom START");

            DatePickerStyle style = new DatePickerStyle()
            {
                CellPadding = new Size2D(100, 200),
                Pickers     = new PickerStyle()
                {
                    ItemTextLabel = new TextLabelStyle()
                    {
                        EnableAutoScroll = true,
                        Ellipsis         = true,
                    }
                }
            };

            var testingTarget = new DatePickerStyle();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <DatePickerStyle>(testingTarget, "Should return DatePickerStyle instance.");

            try
            {
                testingTarget.CopyFrom(style);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"DatePickerStyleCopyFrom END (OK)");
        }
Exemple #4
0
        public void DatePickerStyleConstructor()
        {
            tlog.Debug(tag, $"DatePickerStyleConstructor START");

            DatePickerStyle style = new DatePickerStyle()
            {
                CellPadding = new Size2D(100, 200),
                Pickers     = new PickerStyle()
                {
                    ItemTextLabel = new TextLabelStyle()
                    {
                        EnableAutoScroll = true,
                        Ellipsis         = true,
                    }
                }
            };

            var testingTarget = new DatePickerStyle(style);

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <DatePickerStyle>(testingTarget, "Should return DatePickerStyle instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"DatePickerStyleConstructor END (OK)");
        }
Exemple #5
0
            public GtkDatePickerEntry(DatePickerStyle style) : base(DateTime.MinValue.Ticks,
                                                                    DateTime.MaxValue.Ticks,
                                                                    TimeSpan.TicksPerSecond)
            {
                DatePickerStyle = style;

                Adjustment.PageIncrement = TimeSpan.TicksPerDay;
                IsEditable = true;
                HasFrame   = true;
                DateTime   = DateTime.Now;
                Adjustment.ValueChanged += HandleValueChanged;
            }
Exemple #6
0
        public static NSDatePickerElementFlags ToMacValue(this DatePickerStyle style)
        {
            switch (style)
            {
            case DatePickerStyle.Date:
                return(NSDatePickerElementFlags.YearMonthDateDay);

            case DatePickerStyle.DateTime:
                return(NSDatePickerElementFlags.YearMonthDateDay | NSDatePickerElementFlags.HourMinuteSecond);

            case DatePickerStyle.Time:
                return(NSDatePickerElementFlags.HourMinuteSecond);
            }
            return(NSDatePickerElementFlags.YearMonthDate);
        }
Exemple #7
0
		public DatePicker (DatePickerStyle style, DateTime initialDateTime)
		{
			VerifyConstructorCall (this);
			Style = style;
			DateTime = initialDateTime;
		}
Exemple #8
0
		public DatePicker (DatePickerStyle style) : this (style, DateTime.Now)
		{
		}
 public DatePicker(DatePickerStyle style, DateTime initialDateTime)
 {
     VerifyConstructorCall(this);
     Style    = style;
     DateTime = initialDateTime;
 }
 public DatePicker(DatePickerStyle style) : this(style, DateTime.Now)
 {
 }
Exemple #11
0
			public GtkDatePickerEntry (DatePickerStyle style) : base (DateTime.MinValue.Ticks,
			                                                          DateTime.MaxValue.Ticks,
			                                                          TimeSpan.TicksPerSecond)
			{
				Style = style;

				Adjustment.PageIncrement = TimeSpan.TicksPerDay;
				IsEditable = true;
				HasFrame = true;
				DateTime = DateTime.Now;
				Adjustment.ValueChanged += HandleValueChanged;
			}