Example #1
0
        // Update a calendar using PlanningLibrary (layered code on google calendar)
        public void updateCalendar(XmlDocument doc)
        {
            // Parsing data from XmlDocument
            XmlNodeList titel      = doc.GetElementsByTagName("eventName");
            XmlNodeList id         = doc.GetElementsByTagName("UUID");
            XmlNodeList xmlVersion = doc.GetElementsByTagName("version");

            // Logging parsed data
            Console.WriteLine(titel[0].InnerText);
            Console.WriteLine(id[0].InnerText);
            Console.WriteLine(xmlVersion[0].InnerText);

            // Creating a new <google.api> calendar to update an existing one, filled with parsed data from XmlDocument and finally sent with PlanningLibrary method.
            // Expects a <google.api> calendar, UUID, version
            Google.Apis.Calendar.v3.Data.Calendar calendar = new Google.Apis.Calendar.v3.Data.Calendar();
            calendar.Summary = titel[0].InnerText;
            Calendarss.IupdateCalendarById(calendar, id[0].InnerText, xmlVersion[0].InnerText);

            Console.WriteLine("Event successfully updated");
            ControlRoom.SendConfirmationMessage("Planning: Event successfully updated");
        }
Example #2
0
        public static void testCalendar()
        {
            GService g    = new GService();
            string   uuid = "testUUID3";
            //create calendar
            //!ALways change the UUID!
            var testCalendar = Calendarss.InewCalendar(makeCalendar("calTest"), uuid, "1");

            Console.WriteLine("calendar created");
            Console.ReadKey();

            //update Calendar
            testCalendar.Summary = "updateCalTest";
            Calendarss.IupdateCalendarById(testCalendar, uuid, "2");
            Console.WriteLine("calendar updated");
            Console.ReadKey();

            //delete Calendar
            Calendarss.IdeleteCalendarById(uuid);
            Console.WriteLine("calendar deleted");
            Console.ReadKey();
        }