当前位置: 首页>>代码示例>>C#>>正文


C# Video类代码示例

本文整理汇总了C#中Video的典型用法代码示例。如果您正苦于以下问题:C# Video类的具体用法?C# Video怎么用?C# Video使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Video类属于命名空间,在下文中一共展示了Video类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        internal static void Main()
        {
            // Create book
            var book = new Book("Microsoft", "CLR via C# 4", 10);
            book.Display();
            Console.WriteLine(new string('-', 60));

            // Create video
            var video = new Video("Stanley Kubrick", "A Clockwork Orange", 23, 92);
            video.Display();
            Console.WriteLine(new string('-', 60));

            // Make book borroable, then borrow and display
            Console.WriteLine("Making book borrowable:");
            var borrowableBook = new Borrowable(book);
            borrowableBook.BorrowItem("Nikolay Kostov");
            borrowableBook.BorrowItem("Ivaylo Kenov");
            borrowableBook.Display();
            Console.WriteLine(new string('-', 60));

            // Make video borrowable, then borrow and display
            Console.WriteLine("Making video borrowable:");
            var borrowableVideo = new Borrowable(video);
            borrowableVideo.BorrowItem("Nikolay Kostov");
            borrowableVideo.BorrowItem("Ivaylo Kenov");
            borrowableVideo.Display();
            Console.WriteLine(new string('-', 60));

            // Make only video buyable
            Console.WriteLine("Making video buyable:");
            var buyableAndBorrowableVideo = new Buyable(borrowableVideo, 15);
            buyableAndBorrowableVideo.Display();
            Console.WriteLine(new string('-', 60));
        }
开发者ID:darkyto,项目名称:C-Sharp-Stuctural-Design-Patterns,代码行数:34,代码来源:Program.cs

示例2: WebDriverRecorder

        public WebDriverRecorder(int fps) 
        {
            this.fps = fps;
            if (WebDriverTestBase.browser == WebDriverBrowser.Browser.Android)
            {
                this.screensize = new Size(300, 500);
            }
            else
            {
                this.screensize = new Size(1024,768);
            }
            
            this.frameDelayMs = 1000/fps;
            //Common.Log("The current dimensions are : " + screensize.Width + " x " + screensize.Height);
            video = new FlashScreenVideo(new FlashScreenVideoParameters(screensize.Width, screensize.Height, fps));

            screenshotGetter = new BackgroundWorker();
            screenshotGetter.DoWork += screenshotGetter_DoWork;
            screenshotGetter.WorkerSupportsCancellation = true;
            screenshotGetter.RunWorkerAsync();

            videoBuilder = new BackgroundWorker();
            videoBuilder.DoWork += videoBuilder_DoWork;
            videoBuilder.WorkerSupportsCancellation = true;
            videoBuilder.RunWorkerAsync();

        }
开发者ID:tokarthik,项目名称:ProtoTest.Golem,代码行数:27,代码来源:WebDriverRecorder.cs

示例3: OnVideoEncoded

 protected virtual void OnVideoEncoded(Video video)
 {
     if (VideoEncoded != null)
     {
         VideoEncoded(this, new VideoEventArgs() {Video = video});//EventArgs.Empty);
     }
 }
开发者ID:turhany,项目名称:advance-sharp-samples,代码行数:7,代码来源:VideoEncoder.cs

示例4: init

		private void init(string filename, Stream stream, ShaderVersions shaderVersion, ShaderFloatingPointQuality vsQuality, ShaderFloatingPointQuality psQuality, Loader.LoadedCallbackMethod loadedCallback)
		#endif
		{
			try
			{
				video = Parent.FindParentOrSelfWithException<Video>();

				#if WIN32
				shaderVersion = (shaderVersion == ShaderVersions.Max) ? video.Cap.MaxShaderVersion : shaderVersion;
				var code = getShaders(stream);
				vertex = new VertexShader(this, code[0], shaderVersion);
				pixel = new PixelShader(this, code[1], shaderVersion);
				#else
				await getReflections(filename);
				var code = getShaders(stream);
				vertex = new VertexShader(this, code[0]);
				pixel = new PixelShader(this, code[1]);
				#endif

				variables = new List<ShaderVariable>();
				resources = new List<ShaderResource>();
			}
			catch (Exception e)
			{
				FailedToLoad = true;
				Loader.AddLoadableException(e);
				Dispose();
				if (loadedCallback != null) loadedCallback(this, false);
				return;
			}

			Loaded = true;
			if (loadedCallback != null) loadedCallback(this, true);
		}
开发者ID:reignstudios,项目名称:ReignSDK,代码行数:34,代码来源:Shader.cs

示例5: Add

        public ActionResult Add(string t, string k, string d, string imageurl, string u, string um)
        {
            string result = "发布失败";

            if (Session["UserId"] == null)
            {
                return Content("长时间未操作,请重新登录。");
            }

            if (!string.IsNullOrEmpty(t) && !string.IsNullOrEmpty(k) && !string.IsNullOrEmpty(d) && !string.IsNullOrEmpty(imageurl) && !string.IsNullOrEmpty(u) && !string.IsNullOrEmpty(um))
            {
                Video video = new Video();
                video.Title = t;
                video.Keywords = k;
                video.Description = d;
                video.Thumbnail = imageurl;
                video.Url = u;
                video.UrlM = um;
                video.InsertTime = DateTime.Now;
                video.ViewTime = 0;

                VideoService videoService = new VideoService();
                if (videoService.AddVideo(video))
                {
                    result = "success";
                }
            }
            else
            {
                result = "必填项不能为空";
            }
            return Content(result);
        }
开发者ID:Oldsooh,项目名称:XGDG,代码行数:33,代码来源:VideoController.cs

示例6: VideoAnimation

 /*
  * Constructor
  */
 public VideoAnimation(Rectangle windowAreaRectangle, Video video)
 {
     this.windowAreaRectangle = windowAreaRectangle;
     this.video = video;
     videoPlayer = new VideoPlayer();
     videoPlayer.IsLooped = false;
 }
开发者ID:ruizz,项目名称:PangTang,代码行数:10,代码来源:VideoAnimation.cs

示例7: GetVideoImage

        public async Task<DynamicImageResponse> GetVideoImage(Video item, CancellationToken cancellationToken)
        {
            var isoMount = await MountIsoIfNeeded(item, cancellationToken).ConfigureAwait(false);

            try
            {
                // If we know the duration, grab it from 10% into the video. Otherwise just 10 seconds in.
                // Always use 10 seconds for dvd because our duration could be out of whack
                var imageOffset = item.VideoType != VideoType.Dvd && item.RunTimeTicks.HasValue &&
                                  item.RunTimeTicks.Value > 0
                                      ? TimeSpan.FromTicks(Convert.ToInt64(item.RunTimeTicks.Value * .1))
                                      : TimeSpan.FromSeconds(10);

                InputType type;

                var inputPath = MediaEncoderHelpers.GetInputArgument(item.Path, item.LocationType == LocationType.Remote, item.VideoType, item.IsoType, isoMount, item.PlayableStreamFileNames, out type);

                var stream = await _mediaEncoder.ExtractImage(inputPath, type, false, item.Video3DFormat, imageOffset, cancellationToken).ConfigureAwait(false);

                return new DynamicImageResponse
                {
                    Format = ImageFormat.Jpg,
                    HasImage = true,
                    Stream = stream
                };
            }
            finally
            {
                if (isoMount != null)
                {
                    isoMount.Dispose();
                }
            }
        }
开发者ID:Tensre,项目名称:MediaBrowser,代码行数:34,代码来源:VideoImageProvider.cs

示例8: DeleteVideo

 public void DeleteVideo(int videoID)
 {
     var video = new Video() { VideoID = videoID };
     _context.Videos.Attach(video);
     _context.Videos.Remove(video);
     _context.SaveChanges();
 }
开发者ID:smashdevcode,项目名称:windows-azure-demo,代码行数:7,代码来源:Repository.cs

示例9: Create

        public ActionResult Create(Video video, Frame frame)
        {
            video.Frame = frame;

            if (ModelState.IsValid)
            {
                if (video.SavedContentId.HasValue)
                {
                    Content content = db.Contents.Find(video.SavedContentId.Value);
                    video.Contents.Add(content);
                    db.Videos.Add(video);
                    db.SaveChanges();

                    return this.RestoreReferrer() ?? RedirectToAction("Index", "Frame");
                }
                else
                {
                    TempData["_newVideo"] = video;
                    return RedirectToAction("Upload", "Video");
                }
            }

            this.FillTemplatesSelectList(db, FrameTypes.Video, video.Frame.TemplateId);
            FillVideosSelectList();

            return View(video);
        }
开发者ID:Fivebread,项目名称:DisplayMonkey,代码行数:27,代码来源:VideoController.cs

示例10: GameVideo

 public GameVideo(Video video)
 {
     _video = video;
      _videoPlayer = new VideoPlayer();
      kinput = new KeyboardInput();
      gInput = new GamePadInput();
 }
开发者ID:robertg,项目名称:Soar,代码行数:7,代码来源:GameVideo.cs

示例11: PostVideo

        public async Task<IHttpActionResult> PostVideo(Video video)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.Videos.Add(video);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (VideoExists(video.VideoId))
                {
                    return Conflict();
                }
                else
                {
                    throw;
                }
            }

            return CreatedAtRoute("DefaultApi", new { id = video.VideoId }, video);
        }
开发者ID:linkin2016,项目名称:NoticeWebAPI,代码行数:27,代码来源:VideosController.cs

示例12: PutVideo

        public async Task<IHttpActionResult> PutVideo(string id, Video video)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != video.VideoId)
            {
                return BadRequest();
            }

            db.Entry(video).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VideoExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
开发者ID:linkin2016,项目名称:NoticeWebAPI,代码行数:32,代码来源:VideosController.cs

示例13: CreateVideoEntity

        public void CreateVideoEntity(string embed,  VideoGallery gallery)
        {
            var embedCode = "";
            int pos = embed.LastIndexOf("/") + 1;
            embedCode = embed.Substring(pos, embed.Length - pos);

            VideoType videoType;

            if (embed.ToLower().Contains("youtu"))
            {
                videoType = VideoType.Youtube;
            }
            else if (embed.ToLower().Contains("vimeo"))
            {
                videoType = VideoType.Vimeo;
            }
            else
            {
                videoType = VideoType.Other;
            }

            var video = new Video
            {
                Embed = embedCode,
                VideoType = videoType,
                VideoGallery = gallery
            };

            this.CreateVideo(video);
        }
开发者ID:johannest09,项目名称:Xland2014,代码行数:30,代码来源:VideoService.cs

示例14: OnVideoEncoded

        protected void OnVideoEncoded(Video video)
        {
            if (videoEncoded != null)
                //videoEncoded(this, new VideoEventArgs() { Video = video  });
                videoEncoded(this, new VideoEventArgs() { Video = video });

        }
开发者ID:junaidameen,项目名称:Tutorials,代码行数:7,代码来源:VideoEncoder.cs

示例15: GetVideos

        public List<Video> GetVideos()
        {
            VideoData.videosDataTable DT = db.GetVideos();
            List<Video> videos = new List<Video>();
            foreach (var item in DT)
            {
                Video vid = new Video();
                vid.Id = item.Video_ID;
                if (item.Url == null)
                    vid.Url = "";
                else
                    vid.Url = item.Url;
                if (item.Description == null)
                    vid.Description = "No Description";
                else
                    vid.Description = item.Description;
                if (item.Name == null)
                    vid.Name = "No Name";
                else
                    vid.Name = item.Name;

                videos.Add(vid);
            }

            return videos;

        }
开发者ID:orenger,项目名称:Project---Autism,代码行数:27,代码来源:Video.cs


注:本文中的Video类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。