本文整理汇总了C#中Clock.setMonth方法的典型用法代码示例。如果您正苦于以下问题:C# Clock.setMonth方法的具体用法?C# Clock.setMonth怎么用?C# Clock.setMonth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Clock
的用法示例。
在下文中一共展示了Clock.setMonth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeClock
private Clock InitializeClock()
{
CreateDropDowns();
Clock c = new Clock();
if (dDL1.SelectedIndex == 0) c.setYear(-1);
else c.setYear((DateTime.Now.Year + dDL1.SelectedIndex - 1));
if (dDL2.SelectedIndex == 0) c.setMonth(-1);
else c.setMonth(dDL2.SelectedIndex);
if (rB1.Checked)
{
if (dDL3.SelectedIndex == 0) c.setDay(-1);
else c.setDay(dDL3.SelectedIndex);
}
else
{
if (dDL11.SelectedIndex == 0) c.setDay(-1);
else c.setDay(39 + dDL11.SelectedIndex);
}
if (dDL4.SelectedIndex == 0) c.setHour(-1);
else c.setHour(dDL4.SelectedIndex + dDL12.SelectedIndex * 12);
if (dDL5.SelectedIndex == 0) c.setMinute(-1);
else c.setMinute(dDL5.SelectedIndex - 1);
if (dDL6.SelectedIndex == 0) c.setSecond(-1);
else c.setSecond(dDL6.SelectedIndex - 1);
return c;
}
示例2: InitializeClock
private Clock InitializeClock()
{
Clock c = new Clock();
if (DropDownList1.SelectedIndex == 0) c.setYear(-1);
else c.setYear((DateTime.Now.Year + DropDownList1.SelectedIndex - 1));
if (DropDownList2.SelectedIndex == 0) c.setMonth(-1);
else c.setMonth(DropDownList2.SelectedIndex);
if (RadioButton1.Checked)
{
if (DropDownList3.SelectedIndex == 0) c.setDay(-1);
else c.setDay(DropDownList3.SelectedIndex);
}
else
{
if (DropDownList11.SelectedIndex == 0) c.setDay(-1);
else c.setDay(39 + DropDownList11.SelectedIndex);
}
if (DropDownList4.SelectedIndex == 0) c.setHour(-1);
else c.setHour(((DropDownList4.SelectedIndex) % 12 + DropDownList12.SelectedIndex * 12) % 24);
if (DropDownList5.SelectedIndex == 0) c.setMinute(-1);
else c.setMinute(DropDownList5.SelectedIndex - 1);
if (DropDownList6.SelectedIndex == 0) c.setSecond(-1);
else c.setSecond(DropDownList6.SelectedIndex - 1);
return c;
}