public List<Task<Event>> PublishSchedule(Aurora.ScheduleSubject subject)
        {
            var tasks = new List<Task<Event>>();
            foreach (Aurora.ScheduleSubject.Block block in subject.Blocks)
            {
                var start_date = new DateTime(block.StartDate.Year, block.StartDate.Month, block.StartDate.Day, block.StartHour.Hour, block.StartHour.Minute, block.StartHour.Second);
                var end_hour = block.StartHour.Add(block.Duration);
                var description = "Class in " + block.Location + " with " + subject.Professors;
                var until = block.EndDate.Year.ToString() + block.EndDate.Month.ToString("00") + block.EndDate.Day.ToString("00") +
                    "T" + end_hour.Hour.ToString("00") + end_hour.Minute.ToString("00") + end_hour.Second.ToString("00") + "Z";
                var ev = new Event()
                {
                    Summary = subject.Name,
                    Description = description,
                    Start = new EventDateTime() {
                        DateTime = start_date,
                        TimeZone = "America/Bogota"
                    },
                    End = new EventDateTime() {
                        DateTime = start_date.Add(block.Duration),
                        TimeZone = "America/Bogota"
                    },
                    Recurrence = new String[] {
                        "RRULE:FREQ=WEEKLY;UNTIL=" + until
                    },
                    Location = "Universidad del Norte, Barranquilla, Colombia"
                };

                tasks.Add(service.Events.Insert(ev, "primary").ExecuteAsync());
            }
            return tasks;
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (aurora != null)
            {
                MessageBox.Show("You must first log out");
                return;
            }

            aurora = new Aurora(username_text.Text, password_text.Text);
            InitiateRequest();
        }
Ejemplo n.º 3
0
 private void button3_Click(object sender, EventArgs e)
 {
     button2.Enabled = false;
     button4.Enabled = false;
     terms_box.DataSource = null;
     aurora.Dispose();
     aurora = null;
 }