コード例 #1
0
        public static async Task <List <ChimeMeeting> > GetMeetingsAsync(bool autoLaunchOutlook)
        {
            var meetings  = new List <ChimeMeeting>();
            var calendars = await OutlookHelper.GetCalendars(autoLaunchOutlook);

            foreach (var calendar in calendars)
            {
                var appointments = OutlookHelper.GetAppointmentsAroundNow(calendar);

                if (appointments == null)
                {
                    continue;
                }

                foreach (Outlook.AppointmentItem appointment in appointments)
                {
                    // TODO (if needed): GetPins() will collapse duplicate pins for a specific meeting
                    //                   but we may need to collapse duplicate meetings across calendars
                    var pins = GetPins(appointment);

                    if (pins.Count > 0)
                    {
                        meetings.Add(
                            new ChimeMeeting()
                        {
                            Subject   = appointment.Subject,
                            StartTime = appointment.Start,
                            EndTime   = appointment.End,
                            Pins      = new List <string>(pins)
                        }
                            );
                    }
                }
            }

            return(meetings.OrderBy(m => m.StartTime).ToList());
        }
コード例 #2
0
 public static bool OutlookRunning()
 {
     return(OutlookHelper.OutlookRunning());
 }