/// <summary> /// 构造函数 并判断格式是否正确 /// </summary> /// <param name="remindinfo"></param> /// <param name="timeconditon"></param> public TimeAndDateOut(RemindInfo remindinfo, TimeCondition timeconditon) { //if (this.Timeconditon.IsSafeDay==true&& this.Timeconditon.IsSafeGetDayNameToNumber==true&& this.Timeconditon.IsSafeHour==true&& this.Timeconditon.IsSafeMinute==true&& this.Timeconditon.IsSafeMonth==true) //{ this.Remindinfo = remindinfo; this.Timeconditon = timeconditon; // } //else //{ // MessageBox.Show("文本解析最后一步出现了错误,请优化你的文本并重新键入"); //} }
private void btnRemind_Click(object sender, EventArgs e) { if (txtRWcontent.Text == "") { RemindInfo.IsHidder = false; labInfo.Text = "您没有输入任何内容!我不知道该怎么办!"; return; } RemindInfo remindinfo = new RemindInfo(txtRWcontent.Text); remindinfo.condition01(); TimeCondition timecondition = new TimeCondition(remindinfo); TimeAndDateOut tdo = new TimeAndDateOut(remindinfo, timecondition); tdo.GetFullDate(); txtRWcontent.Text = tdo.Outtext; }
int _getDayNameToNumber; //将明天后天等转化成数字 /// <summary> /// 构造函数,获取提醒对象 /// </summary> /// <param name="rlnfo">提醒的对象</param> public TimeCondition(RemindInfo rlnfo) { this.RInfo = rlnfo; ParseInfo(); }