Beispiel #1
0
        /// <summary>
        /// Creates the new media object.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="path">The path.</param>
        /// <param name="isActive">if set to <c>true</c> [is active].</param>
        /// <param name="isDefault">if set to <c>true</c> [is default].</param>
        /// <param name="isExample">if set to <c>true</c> [is example].</param>
        /// <returns></returns>
        /// <remarks>Documented by Dev03, 2009-03-23</remarks>
        public static IMedia CreateNewMediaObject(EMedia type, string path, bool isActive, bool isDefault, bool isExample)
        {
            IMedia media;

            switch (type)
            {
            case EMedia.Audio:
                media = new PreviewAudio(path, isActive, isDefault, isExample, null);
                break;

            case EMedia.Image:
                media = new PreviewImage(path, isActive, isDefault, isExample, null);
                break;

            case EMedia.Video:
                media = new PreviewVideo(path, isActive, isDefault, isExample, null);
                break;

            default:
                media = new PreviewMedia(type, path, isActive, isDefault, isExample, null);
                break;
            }
            return(media);
        }
Beispiel #2
0
 /// <summary>
 /// Creates the new media object.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="path">The path.</param>
 /// <param name="isActive">if set to <c>true</c> [is active].</param>
 /// <param name="isDefault">if set to <c>true</c> [is default].</param>
 /// <param name="isExample">if set to <c>true</c> [is example].</param>
 /// <returns></returns>
 /// <remarks>Documented by Dev03, 2009-03-23</remarks>
 public static IMedia CreateNewMediaObject(EMedia type, string path, bool isActive, bool isDefault, bool isExample)
 {
     IMedia media;
     switch (type)
     {
         case EMedia.Audio:
             media = new PreviewAudio(path, isActive, isDefault, isExample, null);
             break;
         case EMedia.Image:
             media = new PreviewImage(path, isActive, isDefault, isExample, null);
             break;
         case EMedia.Video:
             media = new PreviewVideo(path, isActive, isDefault, isExample, null);
             break;
         default:
             media = new PreviewMedia(type, path, isActive, isDefault, isExample, null);
             break;
     }
     return media;
 }