public static void DeleteAlarm(this Client client, Alarm alarm) { IXPFile file = new IXPFile(); file.NetworkFunction = "com.projectgame.clock.alarm.unregisteralarm"; file.PutInfo("alarm_id", "" + alarm.ID); client.NoResponseRequest(file); }
private void btnNew_Click(object sender, EventArgs e) { int hours = -1; int minutes = -1; int seconds = -1; bool hr = int.TryParse(tbHours.Text, out hours); bool mr = int.TryParse(tbMinutes.Text, out minutes); bool sr = int.TryParse(tbSeconds.Text, out seconds); if(!hr || !mr || !sr) { MessageBox.Show("Could not parse time!"); return; } Alarm alarm = new Alarm(-1, tbName.Text, hours, minutes, seconds, cbMon.Checked, cbTue.Checked, cbWed.Checked, cbThu.Checked, cbFri.Checked, cbSat.Checked, cbSun.Checked, cbEnabled.Checked); alarm = _client.AddAlarm(alarm); _alarms.Add(alarm); lbAlarms.Items.Add(alarm.Name); }
public static Alarm AddAlarm(this Client client, Alarm alarm) { IXPFile file = new IXPFile(); file.NetworkFunction = "com.projectgame.clock.alarm.registeralarm"; file.PutInfo("name", alarm.Name); file.PutInfo("hours", "" + alarm.Hours); file.PutInfo("minutes", "" + alarm.Minutes); file.PutInfo("seconds", "" + alarm.Seconds); file.PutInfo("mon", alarm.Mon ? "TRUE" : "FALSE"); file.PutInfo("tue", alarm.Tue ? "TRUE" : "FALSE"); file.PutInfo("wed", alarm.Wed ? "TRUE" : "FALSE"); file.PutInfo("thu", alarm.Thu ? "TRUE" : "FALSE"); file.PutInfo("fri", alarm.Fri ? "TRUE" : "FALSE"); file.PutInfo("sat", alarm.Sat ? "TRUE" : "FALSE"); file.PutInfo("sun", alarm.Sun ? "TRUE" : "FALSE"); file.PutInfo("enabled", alarm.Enabled ? "TRUE" : "FALSE"); int id = int.Parse(client.SimpleRequest(file)); alarm.ID = id; return alarm; }
public static Alarm GetAlarm(this Client client, int alarmId) { IXPFile file = new IXPFile(); file.NetworkFunction = "com.projectgame.clock.alarm.getalarm"; file.PutInfo("alarm_id", "" + alarmId); IXPFile response = client.IXPRequest(file); Alarm alarm = new Alarm(); alarm.ID = int.Parse(response.GetInfoValue("id")); alarm.Name = response.GetInfoValue("name"); alarm.Hours = int.Parse(response.GetInfoValue("hours")); alarm.Minutes = int.Parse(response.GetInfoValue("minutes")); alarm.Seconds = int.Parse(response.GetInfoValue("seconds")); alarm.Mon = response.GetInfoValue("mon").Equals("TRUE"); alarm.Tue = response.GetInfoValue("tue").Equals("TRUE"); alarm.Wed = response.GetInfoValue("wed").Equals("TRUE"); alarm.Thu = response.GetInfoValue("thu").Equals("TRUE"); alarm.Fri = response.GetInfoValue("fri").Equals("TRUE"); alarm.Sat = response.GetInfoValue("sat").Equals("TRUE"); alarm.Sun = response.GetInfoValue("sun").Equals("TRUE"); alarm.Enabled = response.GetInfoValue("enabled").Equals("TRUE"); return alarm; }
public AlarmSettings(Alarm alarmWindow) { if (isOpen) { return; } InitializeComponent(); isOpen = true; mainWindow = alarmWindow; ////Create Amount of X Variables //int i = 0; //while (CellCnt >= i) { // i++; // string currentName = "Var" + i.ToString(); //} //Tooltips System.Windows.Forms.ToolTip ToolTipdtASDate = new System.Windows.Forms.ToolTip(); System.Windows.Forms.ToolTip ToolTipnumASHour = new System.Windows.Forms.ToolTip(); System.Windows.Forms.ToolTip ToolTipnumASMin = new System.Windows.Forms.ToolTip(); System.Windows.Forms.ToolTip ToolTiptbASYoutubePath = new System.Windows.Forms.ToolTip(); System.Windows.Forms.ToolTip ToolTiptbASFilePath = new System.Windows.Forms.ToolTip(); System.Windows.Forms.ToolTip ToolTipcbASAlarmSound = new System.Windows.Forms.ToolTip(); System.Windows.Forms.ToolTip ToolTiptbASNote = new System.Windows.Forms.ToolTip(); System.Windows.Forms.ToolTip ToolTipcbAlarmActive = new System.Windows.Forms.ToolTip(); System.Windows.Forms.ToolTip ToolTiplblASHelp = new System.Windows.Forms.ToolTip(); ToolTipdtASDate.SetToolTip(dtASDate, "Please insert your Note that should be attatched to the Alarm."); ToolTipnumASHour.SetToolTip(numASHour, "Here you can Set the Alarm hour."); ToolTipnumASMin.SetToolTip(numASMin, "Here you can Set the Alarm minute."); ToolTiptbASYoutubePath.SetToolTip(tbASYoutubePath, "Please insert your Note that should be attatched to the Alarm."); ToolTiptbASFilePath.SetToolTip(tbASFilePath, "Please insert your Note that should be attatched to the Alarm."); ToolTipcbASAlarmSound.SetToolTip(combASAlarmSound, "Please insert your Note that should be attatched to the Alarm."); ToolTiptbASNote.SetToolTip(tbASNote, "Please insert your Note that should be attatched to the Alarm."); ToolTipcbAlarmActive.SetToolTip(cbASActive, "Alarm will be triggered in the following cases: \n\n -Alarm Checkbox is checked\n\n -a day checkbox is checked (makes Date field inactive)\n -a day checkbox is checked AND the repeat checkbox as well (makes Date field inactive) \n -no day checkbox is checked (makes Date field active) - and the Date+Time is in the future"); ToolTipcbAlarmActive.AutoPopDelay = 20000; ToolTiplblASHelp.SetToolTip(lblASHelp, "Alarm will be triggered in the following cases: \n\n -Alarm Checkbox is checked\n\n -a day checkbox is checked (makes Date field inactive)\n -a day checkbox is checked AND the repeat checkbox as well (makes Date field inactive) \n -no day checkbox is checked (makes Date field active) - and the Date+Time is in the future"); ToolTiplblASHelp.AutoPopDelay = 20000; ToolTiplblASHelp.InitialDelay = 100; }
public static void UpdateAlarmWeekdays(this Client client, Alarm alarm) { IXPFile file = new IXPFile(); file.NetworkFunction = "com.projectgame.clock.alarm.setalarmweekdays"; file.PutInfo("alarm_id", "" + alarm.ID); file.PutInfo("mon", alarm.Mon ? "TRUE" : "FALSE"); file.PutInfo("tue", alarm.Tue ? "TRUE" : "FALSE"); file.PutInfo("wed", alarm.Wed ? "TRUE" : "FALSE"); file.PutInfo("thu", alarm.Thu ? "TRUE" : "FALSE"); file.PutInfo("fri", alarm.Fri ? "TRUE" : "FALSE"); file.PutInfo("sat", alarm.Sat ? "TRUE" : "FALSE"); file.PutInfo("sun", alarm.Sun ? "TRUE" : "FALSE"); client.NoResponseRequest(file); }
public static void UpdateAlarmTime(this Client client, Alarm alarm) { IXPFile file = new IXPFile(); file.NetworkFunction = "com.projectgame.clock.alarm.setalarmtime"; file.PutInfo("alarm_id", "" + alarm.ID); file.PutInfo("hours", "" + alarm.Hours); file.PutInfo("minutes", "" + alarm.Minutes); file.PutInfo("seconds", "" + alarm.Seconds); client.NoResponseRequest(file); }
public static void UpdateAlarmName(this Client client, Alarm alarm) { IXPFile file = new IXPFile(); file.NetworkFunction = "com.projectgame.clock.alarm.setalarmname"; file.PutInfo("alarm_id", "" + alarm.ID); file.PutInfo("name", alarm.Name); client.NoResponseRequest(file); }
public static void UpdateAlarmEnabled(this Client client, Alarm alarm) { IXPFile file = new IXPFile(); file.NetworkFunction = "com.projectgame.clock.alarm.setalarmenabled"; file.PutInfo("alarm_id", "" + alarm.ID); file.PutInfo("enabled", alarm.Enabled ? "TRUE" : "FALSE"); client.NoResponseRequest(file); }
public static void UpdateAlarm(this Client client, Alarm alarm) { client.UpdateAlarmName(alarm); client.UpdateAlarmTime(alarm); client.UpdateAlarmWeekdays(alarm); client.UpdateAlarmEnabled(alarm); }