示例#1
0
        public async Task Delete(Guid userId, string eventId)
        {
            try
            {
                var item = _iSysUserService.GetById(userId);

                if (string.IsNullOrEmpty(item.GoogleUserName) || string.IsNullOrEmpty(item.GooglePassword)) return;
                var myService = new CalendarService(item.GoogleUserName);
                myService.setUserCredentials(item.GoogleUserName, item.GooglePassword);

                var calendar =
                    myService.Get("https://www.google.com/calendar/feeds/default/private/full/" + eventId);

                foreach (var item1 in calendar.Feed.Entries)
                {
                    item1.Delete();
                }
            }
            catch
            {
            }
        }