builttoroam / essentials Goto Github PK
View Code? Open in Web Editor NEWThis project forked from xamarin/essentials
Essential cross platform APIs for your mobile apps.
License: Other
This project forked from xamarin/essentials
Essential cross platform APIs for your mobile apps.
License: Other
Remove or alter what is being thrown e.g. sometimes I add what platform is failing, but probably just better off not catching exception in general if I'm not handling it
Found the linkage between variables within this list, see: Link to Event
https://docs.google.com/spreadsheets/d/1-k8TuQpdWh1GRrgFsI9b2qWfobrqlquzSzwsFknMApo/edit#gid=0
Calendar.android.cs
e.g. newEvent null validation in:
if (string.IsNullOrEmpty(newEvent.CalendarId))
var cursor = Platform.AppContext.ApplicationContext.ContentResolver;
Calendar API Update to no longer be read-only but will now have CRUD access to events for calendars seamlessly across uwp, iOS and Android.
API | Description |
---|---|
Task<IEnumerable<DeviceCalendar>> GetCalendarsAsync() |
Retrieve all calendars for device |
Task<IEnumerable<DeviceEvent>> GetEventsAsync( string calendarId = null, DateTimeOffset? startDate = null, DateTimeOffset? endDate = null) |
Retrieve all events for a specified range/calendar, null will use defaults: calendarId will default to all Calendars retrieved, startDate will default to use, DefaultStartDate , endDate will default to use DefaultEndDate |
Task<DeviceEvent> GetEventByIdAsync(string eventId) |
Gets more detailed information about a specific event by the event id |
Task<string> CreateEvent(DeviceEvent newEvent) |
Create event with parameters passed in via newEvent, returns id of created event. |
Task<bool> UpdateEvent(DeviceEvent updatedEvent) |
Update event to match parameters provided via updatedEvent, returns bool indicating whether update was successful. |
Task<bool> DeleteEvent(string eventId) |
Delete event by Id, returns bool indicating whether deletion was successful |
Task<bool> AddAttendee(DeviceEventAttendee newAttendee, string eventId) |
Add a new attendee to an event by event Id, returns bool indicating whether adding the attendee was successful. |
Task<bool> RemoveAttendee(string attendeeEmail, string eventId) |
Remove attendee from event based on attendee email and event Id, returns bool indicating whether removing attendee from event was successful |
public class DeviceCalendar
{
public string Id { get; set; }
public string Name { get; set; }
public bool IsReadOnly { get; set; }
}
public class DeviceEvent
{
public string Id { get; set; }
public string CalendarId { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Location { get; set; }
public bool AllDay { get; set; }
public DateTimeOffset StartDate { get; set; }
public TimeSpan? Duration { get; set; }
public DateTimeOffset? EndDate { get; set; }
public IEnumberable<Attendee> Attendees { get; set; }
}
public class DeviceEventAttendee
{
public string Name { get; set; }
public string Email { get; set; }
}
(suggested TimeSpanExtensions)
Not too fussed about this but I would try to avoid abbreviations in code and use full names instead
var app = new Appointment()
Allow functions to request/check Calendar app permissions before proceeding.
This should be a modification to the existing Permissions API to support requesting Calendar permission. We'll need to add Calendar to the PermissionType enumeration
eventValues.Put(CalendarContract.Events.InterfaceConsts.Dtend, newEvent.EndDate.HasValue ? newEvent.EndDate.Value.ToUnixTimeMilliseconds().ToString() : newEvent.StartDate.AddDays(1).ToString());
It looks pretty arbitrary that we're adding a day if the end date hasn't been provided. Couple of questions:
Should we be even providing an end date if it's not provided?
Why are we adding exactly 1 day?
If we need to provide a value and it will be an arbitrary number, I feel that we might want to leave a comment why about it.
public ICommand CreateCalendar { get; } = new Command(CreateCalendarCommand);
Calendar API for reading calendar/event information seamlessly across uwp, iOS and Android
API | Description |
---|---|
Task<IReadOnlyList<ICalendar>> GetCalendarsAsync() |
Retrieve all calendars for device |
Task<IReadOnlyList<IEvent>> GetEventsAsync( string calendarId = null, DateTimeOffset? startDate = null, DateTimeOffset? endDate = null) |
Retrieve all events for a specified range/calendar, null will use defaults: calendarId will default to all Calendars retrieved, startDate will default to use, DefaultStartDate , endDate will default to use DefaultEndDate |
Task<IEvent> GetEventByIdAsync(string eventId) |
Gets more detailed information about a specific event by the event id |
public class DeviceCalendar
{
public string Id { get; set; }
public string Name { get; set; }
}
public class DeviceEvent
{
public string Id { get; set; }
public string CalendarId { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Location { get; set; }
public bool AllDay
{
get => !EndDate.HasValue;
set
{
if (value)
{
EndDate = null;
}
else
{
EndDate = StartDate;
}
}
}
public DateTimeOffset StartDate { get; set; }
public TimeSpan? Duration
{
get => EndDate.HasValue ? EndDate - StartDate : null;
set
{
if (value.HasValue)
{
EndDate = StartDate.Add(value.Value);
}
else
{
EndDate = null;
}
}
}
public DateTimeOffset? EndDate { get; set; }
public List<Attendee> Attendees { get; set; }
}
public class DeviceEventAttendee
{
public string Name { get; set; }
public string Email { get; set; }
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.