Exemple #1
0
        public override Fragment GetItem(int position)
        {
            switch (position)
            {
            case 0:
            {
                DateFragment dateFragment = DateFragment.NewInstance(
                    mDialogFragment.MyTheme,
                    mDialogFragment.Calendar.Year,
                    mDialogFragment.Calendar.Month - 1,
                    mDialogFragment.Calendar.Day,
                    mDialogFragment.MinDate,
                    mDialogFragment.MaxDate);
                dateFragment.SetTargetFragment(mDialogFragment, 200);
                return(dateFragment);
            }

            case 1:
            {
                TimeFragment timeFragment = TimeFragment.NewInstance(
                    mDialogFragment.MyTheme,
                    mDialogFragment.Calendar.Hour,
                    mDialogFragment.Calendar.Minute,
                    mDialogFragment.IsClientSpecified24HourTime,
                    mDialogFragment.Is24HourTime);
                timeFragment.SetTargetFragment(mDialogFragment, 200);
                return(timeFragment);
            }

            default:
                return(null);
            }
        }
        public static DateFragment NewInstance(int theme, int year, int month,
            int day, DateTime minDate, DateTime maxDate)
        {
            DateFragment t = new DateFragment();

            Bundle b = new Bundle();
            b.PutInt("theme", theme);
            b.PutInt("year", year);
            b.PutInt("month", month);
            b.PutInt("day", day);
            b.PutLong("minDate", minDate.Ticks);
            b.PutLong("maxDate", maxDate.Ticks);
            t.Arguments = b;

            return t;
        }
Exemple #3
0
        public static DateFragment NewInstance(int theme, int year, int month,
                                               int day, DateTime minDate, DateTime maxDate)
        {
            DateFragment t = new DateFragment();

            Bundle b = new Bundle();

            b.PutInt("theme", theme);
            b.PutInt("year", year);
            b.PutInt("month", month);
            b.PutInt("day", day);
            b.PutLong("minDate", minDate.Ticks);
            b.PutLong("maxDate", maxDate.Ticks);
            t.Arguments = b;

            return(t);
        }