示例#1
0
 public VippyVideoSelectionQuery(VippyWrapper.VippyWrapper vippyWrapper)
 {
     if (vippyWrapper == null)
     {
         throw new ArgumentNullException("vippyWrapper");
     }
     _vippyWrapper = vippyWrapper;
 }
示例#2
0
        public VirtualPathProvider(string name, NameValueCollection configParameters)
            : base(name, configParameters)
        {
            ValidateAndSetupConfigParams();
            VirtualPathRoot = VirtualPathUtility.ToAbsolute(ConfigurationParameters["virtualPath"]);

            _root        = new RootDirectory(this);
            _vippyClient = new VippyWrapper.VippyWrapper(ConfigurationParameters["apiKey"], ConfigurationParameters["secretKey"]);
        }
示例#3
0
        private IEnumerable<Video> GetVideos()
        {
            string cacheKey = "vippyvideos";

            var videos = HttpRuntime.Cache.Get(cacheKey) as List<Video>;

            if (videos == null)
            {
                var wrapper = new VippyWrapper.VippyWrapper(VippyConfiguration.ApiKey,
                    VippyConfiguration.SecretKey);

                videos = (wrapper.GetVideos().Result).ToList();

                HttpRuntime.Cache.Insert(cacheKey, videos, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(1));
            }

            return videos;
        }
示例#4
0
        private IEnumerable <Video> GetVideos()
        {
            string cacheKey = "vippyvideos";

            var videos = HttpRuntime.Cache.Get(cacheKey) as List <Video>;

            if (videos == null)
            {
                var wrapper = new VippyWrapper.VippyWrapper(VippyConfiguration.ApiKey,
                                                            VippyConfiguration.SecretKey);

                videos = (wrapper.GetVideos().Result).ToList();

                HttpRuntime.Cache.Insert(cacheKey, videos, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(1));
            }

            return(videos);
        }
示例#5
0
 public VippyVideoSelectionQuery(VippyWrapper.VippyWrapper vippyWrapper)
 {
     if (vippyWrapper == null) throw new ArgumentNullException("vippyWrapper");
     _vippyWrapper = vippyWrapper;
 }