本文整理汇总了C#中Calendar.Set方法的典型用法代码示例。如果您正苦于以下问题:C# Calendar.Set方法的具体用法?C# Calendar.Set怎么用?C# Calendar.Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calendar
的用法示例。
在下文中一共展示了Calendar.Set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalendarAdapter
public CalendarAdapter(Context c, Calendar monthCalendar) {
month = monthCalendar;
selectedDate = (Calendar)monthCalendar.Clone();
mContext = c;
month.Set(Calendar.DayOfMonth, 1);
this.items = new ArrayList();
refreshDays();
}
示例2: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.Main);
month = Calendar.Instance;
//Static date set
System.String date = "2015-07-31";
char[] splitchar = { '-' };
System.String[] dateArr = date.Split(splitchar); // date format is yyyy-mm-dd
//month.set(Integer.parseInt(dateArr[0]), Integer.parseInt(dateArr[1]), Integer.parseInt(dateArr[2]));
month.Set(Int16.Parse(dateArr[0]), Int16.Parse(dateArr[1]),Int16.Parse(dateArr[2]));
items = new ArrayList();
adapter = new CalendarAdapter(this, month);
date_date ();
GridView gridview = (GridView)FindViewById (Resource.Id.gridview);
gridview.SetAdapter(adapter);
gridview.ItemClick += grid_click;
TextView title = (TextView) FindViewById(Resource.Id.title);
title.Text = Android.Text.Format.DateFormat.Format("MMMM yyyy",month);
TextView previous = (TextView) FindViewById (Resource.Id.previous);
previous.Click += previous_click;
TextView next = (TextView) FindViewById (Resource.Id.next);
next.Click += next_click;
}