Example #1
0
        public GoogleCalendarService(string user)
        {
            if (Credential == null)
            {
                throw new Exception("CalendarService must be configured before instantiation.");
            }

            var credential = Credential
                             .CreateScoped(CalendarService.Scope.Calendar)
                             .CreateWithUser(user);

            var initializer = new BaseClientService.Initializer
            {
                HttpClientInitializer = credential,
                ApplicationName       = ApplicationName
            };

            Service = new CalendarService(initializer);
        }