protected void createTask()
        {
            SchedulingManager manager = SchedulingManager.GetManager();
            string myKey = "D92F7C6F-A121-4f15-87F7-04ABBE0D7BE0";

            var count = manager.GetTaskData().Where(i => i.Key == myKey).ToList().Count;

            //if (count != 0)
            //{
            //	manager.DeleteTaskData(manager.GetTaskData().Where(i => i.Key == myKey).ToList().FirstOrDefault());
            //}
            //count = manager.GetTaskData().Where(i => i.Key == myKey).ToList().Count;

            if (count == 0)
            {
                ScheduledVideoSync newTask = new ScheduledVideoSync()
                {
                    Key = myKey
                };
                manager.AddTask(newTask);
                manager.SaveChanges();
            }
        }
        public override void ExecuteTask()
        {
            //If no url is provided, die
            if (webVidConfig.FeedUri.IsNullOrWhitespace())
                return;
            #region Execute Task
            {
                Type syncedVideoType;
                var providerName = "OpenAccessProvider";
                dynamicModuleManager = DynamicModuleManager.GetManager(providerName);
                syncedVideoType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.SyncedVideos.SyncedVideo");
                List<google.Video> videos;
                DateTime lastRan;
                CallVideoService callService = new CallVideoService(webVidConfig.FeedUri);

                DateTime.TryParse(webVidConfig.LastRuntime, out lastRan);

                videos = callService.GetVideos().ToList();

                foreach (google.Video vid in videos)
                {
                    var myVideo = dynamicModuleManager.GetDataItems(syncedVideoType).Where(i => i.GetValue<string>("YouTubeVidId") == vid.VideoId && i.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Master).FirstOrDefault();
                    // if lastRan is set and (vid.YouTubeEntry.Published.Ticks > lastRan.Ticks || vid.YouTubeEntry.Updated.Ticks > lastRan.Ticks)
                    if (webVidConfig.LastRuntime.IsNullOrWhitespace() || vid.YouTubeEntry.Published.Ticks > lastRan.Ticks || vid.YouTubeEntry.Updated.Ticks > lastRan.Ticks)
                        callService.createUpdateVideo(myVideo, vid);
                }
            }
            #endregion
            #region Rescheduling task
            {
                //Update Configuration Time
                ConfigManager manager = ConfigManager.GetManager();
                manager.Provider.SuppressSecurityChecks = true;
                WebVideoSyncConfig config = manager.GetSection<WebVideoSyncConfig>();
                config.LastRuntime = DateTime.UtcNow.ToString();
                manager.SaveSection(config);
                manager.Provider.SuppressSecurityChecks = false;

                //Reschedule Task
                SchedulingManager schedulingManager = SchedulingManager.GetManager();
                ScheduledVideoSync newTask = new ScheduledVideoSync();
                schedulingManager.AddTask(newTask);
                schedulingManager.SaveChanges();
            }
            #endregion
        }