예제 #1
0
        public static bool TryGetAspects(IDictionary <Guid, IList <MediaItemAspect> > aspectData,
                                         MultipleMediaItemAspectMetadata mediaItemAspectMetadata, out IList <MultipleMediaItemAspect> values)
        {
            values = null;
            IList <MediaItemAspect> mediaAspects;

            if (!aspectData.TryGetValue(mediaItemAspectMetadata.AspectId, out mediaAspects) || mediaAspects.Count == 0)
            {
                return(false);
            }

            values = new List <MultipleMediaItemAspect>();
            foreach (MediaItemAspect mediaAspect in mediaAspects)
            {
                values.Add((MultipleMediaItemAspect)mediaAspect);
            }
            return(true);
        }
예제 #2
0
 /// <summary>
 /// Creates a new media item aspect instance for the specified media item aspect <paramref name="metadata"/>.
 /// </summary>
 /// <param name="metadata">Media item aspect specification.</param>
 public MultipleMediaItemAspect(MultipleMediaItemAspectMetadata metadata) : base(metadata)
 {
 }
예제 #3
0
        /// <summary>
        /// Convenience method to get a <see cref="MediaItemAspect"/> from the given <paramref name="aspects"/> dictionary or add a new instance to the
        /// dictionary and return it.
        /// </summary>
        /// <param name="aspects">Dictionary of MediaItemAspects.</param>
        /// <param name="mediaItemAspectMetadata">Definiton of metadata that is used for creation.</param>
        public static MultipleMediaItemAspect CreateAspect(IDictionary <Guid, IList <MediaItemAspect> > aspects, MultipleMediaItemAspectMetadata mediaItemAspectMetadata)
        {
            MultipleMediaItemAspect mediaAspect = new MultipleMediaItemAspect(mediaItemAspectMetadata);

            AddOrUpdateAspect(aspects, mediaAspect);
            return(mediaAspect);
        }