コード例 #1
0
 public VideoStreamViewModel(VideoStream stream)
     : this()
 {
     this.Source = stream.Source;
     this.IsPublic = stream.IsPublic;
     this.IsLive = stream.IsLive;
 }
コード例 #2
0
 public EditStreamGroupsViewModel(VideoStream stream) : this()
 {
     this.VideoStreamId = (int)stream.VideoStreamId;
     this.Name = stream.Name;
     this.Description = stream.Description;
     this.Source = stream.Source;
     this.IsPublic = stream.IsPublic;
     this.IsLive = stream.IsLive;
     this.OwnerId = stream.OwnerId;
 }
コード例 #3
0
        public void SaveVideoStream(VideoStream videoVideoStream)
        {
            if (context.VideoStreams.Count(b => b.VideoStreamId == videoVideoStream.VideoStreamId) != 0)
            {
                context.VideoStreams.Single(b => b.VideoStreamId == videoVideoStream.VideoStreamId).Update(videoVideoStream);
            }
            else
            {
                context.VideoStreams.Add(videoVideoStream);
            }

            context.SaveChanges();
        }
コード例 #4
0
 public VideoStreamViewModel(VideoStream stream, string userId)
     : this()
 {
     this.Source = stream.Source;
     this.IsLive = stream.IsLive;
     if (stream.IsPublic)
     {
         this.IsPublic = true;
     }
     else
     {
         var identityManager = new IdentityManager();
         this.IsPublic = identityManager.IsUserInRole(userId, "Member");
     }
 }
コード例 #5
0
 public void DeleteVideoStream(VideoStream videoVideoStream)
 {
     context.VideoStreams.Remove(videoVideoStream);
     context.SaveChanges();
 }
コード例 #6
0
ファイル: VideoStream.cs プロジェクト: W1R3D-Code/TheExordium
 /// <summary>
 /// Updates the specified new videoStream.
 /// </summary>
 /// <param name="videoStream">The new videoStream.</param>
 public void Update(VideoStream videoStream)
 {
     this.Name = videoStream.Name;
     this.Description = videoStream.Description;
     this.Source = videoStream.Source;
     this.OwnerId = videoStream.OwnerId;
     if (this.Created == DateTime.MinValue)
     {
         this.Created = DateTime.Now;
     }
     this.Modified = DateTime.Now;
 }