示例#1
0
        public void Add(Event newEvent)
        {
            events.Add(newEvent);

            PersistencyService.SaveEventsAsJsonAsync(newEvent);
            LoadEventsAsync();
        }
 public void Remove(Event eet)
 {
     if (eet != null)
     {
         Events.Remove(eet);
         PersistencyService.SaveEventsAsJsonAsync(Events);
         LoadEventAsync();
     }
 }
示例#3
0
        public async void Remove(Event e)
        {
            if (e != null)
            {
                Events.Remove(e);
                bool result = await PersistencyService.SaveEventsAsJsonAsync(Events);

                if (result = true)
                {
                    LoadFile();
                }
            }
        }
        public void AddEvent(int id, string name, string description, string place, DateTime datetime)
        {
            if (name != null && id != null)
            {
                Event newEvent = new Event(id, name, description, place, datetime);

                _eventcatalog.Add(newEvent);
                PersistencyService.SaveEventsAsJsonAsync(Events);
            }
            else
            {
                throw new ArgumentException("Missing ID or Name");
            }
        }
示例#5
0
 public void Update(int index, Event eventToUpdate)
 {
     Events[index] = eventToUpdate;
     PersistencyService.SaveEventsAsJsonAsync(Events);
 }
示例#6
0
 public void Remove(int index)
 {
     Events.RemoveAt(index);
     PersistencyService.SaveEventsAsJsonAsync(Events);
 }
示例#7
0
 public void Remove(Event eventToBeRemoved)
 {
     ObservableCollection.Remove(eventToBeRemoved);
     PersistencyService.SaveEventsAsJsonAsync(_observableCollection);
 }
示例#8
0
 public void Add(int id, string name, string description, string place, DateTime dateTime)
 {
     ObservableCollection.Add(new Event(id, name, description, place, dateTime));
     PersistencyService.SaveEventsAsJsonAsync(_observableCollection);
 }
 public void Remove(Event e)
 {
     ObservableCollection.Remove(e);
     PersistencyService.SaveEventsAsJsonAsync(ObservableCollection);
 }
示例#10
0
 public void Add(Event e)
 {
     Events.Add(e);
     PersistencyService.SaveEventsAsJsonAsync(Events);
 }