public async Task <ActionResult> Index()
        {
            GoogleAuthentication youtubeAuthen  = new GoogleAuthentication();
            CalendarService      googlecalender = new CalendarService(await youtubeAuthen.GetInitializer());
            var re = googlecalender.Events.List(db.Users.Find(User.Identity.GetUserId()).Email).Execute();

            return(View(re.Items));
        }
        public async Task <ActionResult> Index()
        {
            googlecalender = new CalendarService(await googleAuthen.GetInitializer());
            string pageToken = null;

            do
            {
                //Events events = googlecalender.CalendarList.Get("SmartRoom");
            }while (pageToken != null);


            return(View());
        }
        // creates a broadcast verified
        public async Task <LiveBroadcast> createBroadcast(String kind, String snippetTitle, DateTime startTime, DateTime endTime, String privacyStatus)
        {
            youtube = new YouTubeService(await youtubeAuthen.GetInitializer());
            LiveBroadcast broadcast = new LiveBroadcast();

            // Set broadcast Kind
            broadcast.Kind = kind;

            // Set broadcast snippet
            broadcast.Snippet       = new LiveBroadcastSnippet();
            broadcast.Snippet.Title = snippetTitle;
            broadcast.Snippet.ScheduledStartTime = startTime;
            broadcast.Snippet.ScheduledEndTime   = endTime;

            //Set broadcast status
            broadcast.Status = new LiveBroadcastStatus();
            broadcast.Status.PrivacyStatus = privacyStatus;

            LiveBroadcast returnedBroadcast = youtube.LiveBroadcasts.Insert(broadcast, "id,snippet,contentDetails,status").Execute();


            return(returnedBroadcast);
        }