private void frmToDos_Load(object sender, EventArgs e) { Does = new ToDos(); var t1 = Does.Add("Examen de desarrollo"); var t2 = Does.Add("practica"); var t3 = Does.Add("practica 3"); Does.Do(t3); refreshPendingData(); refreshDoneData(); sbStatus.Text = "Datos cargados correctamente"; }
public virtual void AddItem(ICalendarObject obj) { if (obj == null) { return; } else if (obj is Event) { Events.Add((Event)obj); } else if (obj is ToDo) { ToDos.Add((ToDo)obj); } else if (obj is JournalEntry) { JournalEntries.Add((JournalEntry)obj); } else if (obj is FreeBusy) { FreeBusy.Add((FreeBusy)obj); } else { throw new InvalidCastException(); } }
private async Task ExecuteRefreshCommand() { if (IsBusy) { return; } IsBusy = true; try { var _items = await toDoTable.GetItemsAsync(); ToDos.Clear(); foreach (var item in _items) { ToDos.Add(item); } IsBusy = false; } catch (Exception ex) { await Application.Current.MainPage.DisplayAlert("Error", ex.Message, "OK"); } }
private void InsertToDo(ToDo td) { if (ToDos == null) { LoadToDos(); } ToDos.Add(td); SaveToDos(); }
/// <summary> /// Asks user for the Team member, desciption of task, and the due date. /// Will add this task to the end of the list. /// </summary> /// <param name="member"></param> /// <param name="description"></param> /// <param name="date"></param> public void CreateTask(string member, string description, string date) { ToDo tazk = new ToDo(); tazk.Member = member; tazk.Description = description; tazk.Date = date; ToDos.Add(tazk); }
private void RefreshList() { ToDos.Clear(); var query = database.GetItems <ToDoItem>().OrderByDescending(c => c.Created); foreach (var item in query) { ToDos.Add(item); } }
void ExecuteAdd() { ToDoDetailModel toDo = new ToDoDetailModel(); toDo.Id = Guid.NewGuid().ToString(); toDo.Detail = Detail; toDo.CreationDate = DateTime.Now.ToString(); toDo.ModifiedDate = DateTime.Now.ToString(); _getRealmInstance.Write(() => { _getRealmInstance.Add(toDo); }); ToDos.Add(toDo); }
public bool AddTodo(Todo toDo, int ownerId) { if (toDo == null) { return(false); } try { ToDos.Add(toDo); } catch { return(false); } return(true); }
private void InsertToDo(ToDo td) { ToDos.Add(td); Framework.Persistence.Persist.Save(ToDos, _alias); }
public virtual void Deserialize(System.IO.TextReader rdr, Serializer serializer = null) { if (serializer == null) { serializer = new Serializer(); } string name, value; var parameters = new System.Collections.Specialized.NameValueCollection(); while (rdr.Property(out name, out value, parameters) && !string.IsNullOrEmpty(name)) { switch (name.ToUpper()) { case "BEGIN": switch (value) { case "VEVENT": var e = serializer.GetService <Event>(); e.Calendar = this; Events.Add(e); e.Deserialize(rdr, serializer); break; case "VTIMEZONE": var tz = serializer.GetService <TimeZone>(); tz.Calendar = this; TimeZones.Add(tz); tz.Deserialize(rdr, serializer); break; case "VTODO": var td = serializer.GetService <ToDo>(); td.Calendar = this; ToDos.Add(td); td.Deserialize(rdr, serializer); break; case "VFREEBUSY": var fb = serializer.GetService <FreeBusy>(); fb.Calendar = this; FreeBusy.Add(fb); fb.Deserialize(rdr, serializer); break; case "VJOURNAL": var jn = serializer.GetService <JournalEntry>(); jn.Calendar = this; JournalEntries.Add(jn); jn.Deserialize(rdr, serializer); break; } break; case "CALSCALE": Scale = value; break; case "VERSION": Version = value; break; case "PRODID": ProdID = value; break; case "END": if (value == "VCALENDAR") { return; } break; default: Properties.Add(Tuple.Create(name, value, parameters)); break; } } }
public ToDo Add(ToDo entity) { ToDos.Add(entity); return(entity); }