Esempio n. 1
0
        public void LinkMedia(string relation, string sourceMediaContentId, MediaDto linkedMedia)
        {
            var sourceMedia = this.DocumentList.FirstOrDefault(x => x.ContentId == sourceMediaContentId);

            if (sourceMedia == null)
            {
                throw new Exception("Cannot find the source media");
            }
            if (linkedMedia == null || linkedMedia.ContentId == null || linkedMedia.ContentId == sourceMediaContentId)
            {
                throw new Exception("Invalid linked media");
            }
            LinkedMediaDto lm = new LinkedMediaDto(relation, sourceMedia, linkedMedia);

            this.LinkedMediaList.Add(lm);
        }
Esempio n. 2
0
        public void LinkMedia(string relation, MediaDto sourceMedia, MediaDto linkedMedia, Direction direction = Direction.Bi)
        {
            if (sourceMedia == null)
            {
                throw new Exception("Source Media cannot be null.");
            }
            if (!this.DocumentList.Contains(sourceMedia))
            {
                throw new Exception("Cannot find the source media");
            }
            if (linkedMedia == null)
            {
                throw new Exception("Cannot find the linked media");
            }
            LinkedMediaDto lm = new LinkedMediaDto(relation, sourceMedia, linkedMedia);

            lm.Direction = direction;
            this.LinkedMediaList.Add(lm);
        }
Esempio n. 3
0
 public LinkedMediaDto(string relation, MediaDto sourceMedia, MediaDto linkedMedia)
 {
     this.Relation    = relation;
     this.SourceMedia = sourceMedia;
     this.LinkedMedia = linkedMedia;
 }
Esempio n. 4
0
 public void AddMedia(MediaDto media)
 {
     media.CaseId = this.CaseId;
     this.DocumentList.Add(media);
 }