• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IAlbum类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AlbumViewModel

 public AlbumViewModel(IAlbum iAlbum)
 {
     _Album = iAlbum;
     _ImagesVM = new CollectionWithDetailVM<IAlbumPicture>(_Album.Images);
     var tm = Register(Album.Tracks.LiveOrderBy(t => t.TrackNumber));
     _OrderedTracks = Register(tm.LiveThenBy(t => t.Path));
 }
开发者ID:David-Desmaisons,项目名称:MusicCollection,代码行数:7,代码来源:AlbumViewModel.cs


示例2: Audio

        /// <summary>
        /// Initializes a new instance of a <see cref="Audio" /> object.
        /// </summary>
        /// <param name="audioFile">A <see cref="FileInfo"/> object containing the original audio file for this object. This is intended to be 
        /// specified when creating a new media object from a file. Specify null when instantiating an object for an existing database
        /// record.</param>
        /// <param name="parentAlbum">The album that contains this object. This is a required parameter.</param>
        /// <exception cref="GalleryServerPro.Events.CustomExceptions.InvalidMediaObjectException">Thrown when 
        /// <paramref name="audioFile"/> refers to a file that is not in the same directory as the parent album's directory.</exception>
        /// <exception cref="GalleryServerPro.Events.CustomExceptions.UnsupportedMediaObjectTypeException">Thrown when
        /// <paramref name="audioFile"/> is specified (not null) and its file extension does not correspond to an audio MIME
        /// type, as determined by the MIME type definition in the configuration file.</exception>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="parentAlbum" /> is null.</exception>
        /// <remarks>This constructor does not verify that <paramref name="audioFile"/> refers to a file type that is enabled in the 
        /// configuration file.</remarks>
        internal Audio(FileInfo audioFile, IAlbum parentAlbum)
            : this(int.MinValue, parentAlbum, string.Empty,
						int.MinValue, int.MinValue, int.MinValue, string.Empty, int.MinValue, int.MinValue,
						int.MinValue, string.Empty, int.MinValue, int.MinValue, int.MinValue, int.MinValue,
						String.Empty, DateTime.Now, String.Empty, DateTime.MinValue, parentAlbum != null ? parentAlbum.IsPrivate : false, false, audioFile, null)
        {
        }
开发者ID:Jiyuu,项目名称:galleryserverpro,代码行数:22,代码来源:Audio.cs


示例3: Image

        /// <summary>
        /// Initializes a new instance of an <see cref="Image"/> object.
        /// </summary>
        /// <param name="imageFile">A <see cref="System.IO.FileInfo"/> object containing the original image for this object.</param>
        /// <param name="parentAlbum">The album that contains this object. This is a required parameter.</param>
        /// <exception cref="GalleryServerPro.ErrorHandler.CustomExceptions.InvalidMediaObjectException">Thrown when 
        /// <paramref name="imageFile"/> refers to a file that is not in the same directory as the parent album's directory.</exception>
        /// <exception cref="GalleryServerPro.ErrorHandler.CustomExceptions.UnsupportedMediaObjectTypeException">Thrown when
        /// <paramref name="imageFile"/> is specified (not null) and its file extension does not correspond to an image MIME
        /// type, as determined by the MIME type definition in the configuration file.</exception>
        /// <exception cref="GalleryServerPro.ErrorHandler.CustomExceptions.UnsupportedImageTypeException">Thrown when the 
        /// .NET Framework is unable to load an image file into the <see cref="System.Drawing.Bitmap"/> class. This is 
        /// probably because it is corrupted, not an image supported by the .NET Framework, or the server does not have 
        /// enough memory to process the image. The file cannot, therefore, be handled using the <see cref="Image"/> 
        /// class; use <see cref="GenericMediaObject"/> instead. This exception is thrown only when <paramref name="imageFile"/>
        /// is specified (non-null).</exception>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="parentAlbum" /> is null.</exception>
        /// <remarks>This constructor does not verify that <paramref name="imageFile"/> refers to a file type that is enabled in the 
        /// configuration file.</remarks>
        internal Image(System.IO.FileInfo imageFile, IAlbum parentAlbum)
            : this(int.MinValue, parentAlbum, string.Empty, string.Empty, string.Empty,
				int.MinValue, int.MinValue, int.MinValue, string.Empty, int.MinValue, int.MinValue,
				int.MinValue, string.Empty, int.MinValue, int.MinValue, int.MinValue, int.MinValue,
				String.Empty, DateTime.MinValue, String.Empty, DateTime.MinValue, parentAlbum != null ? parentAlbum.IsPrivate : false, false, imageFile)
        {
        }
开发者ID:KuduApps,项目名称:GalleryServerPro,代码行数:26,代码来源:Image.cs


示例4: Video

        /// <summary>
        /// Initializes a new instance of a <see cref="Video" /> object.
        /// </summary>
        /// <param name="videoFile">A <see cref="FileInfo"/> object containing the original video file for this object. This is intended to be 
        /// specified when creating a new media object from a file. Specify null when instantiating an object for an existing database
        /// record.</param>
        /// <param name="parentAlbum">The album that contains this object. This is a required parameter.</param>
        /// <exception cref="GalleryServerPro.Events.CustomExceptions.InvalidMediaObjectException">Thrown when 
        /// <paramref name="videoFile"/> refers to a file that is not in the same directory as the parent album's directory.</exception>
        /// <exception cref="GalleryServerPro.Events.CustomExceptions.UnsupportedMediaObjectTypeException">Thrown when
        /// <paramref name="videoFile"/> is specified (not null) and its file extension does not correspond to an video MIME
        /// type, as determined by the MIME type definition in the configuration file.</exception>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="parentAlbum" /> is null.</exception>
        /// <remarks>This constructor does not verify that <paramref name="videoFile"/> refers to a file type that is enabled in the 
        /// configuration file.</remarks>
        internal Video(System.IO.FileInfo videoFile, IAlbum parentAlbum)
            : this(int.MinValue, parentAlbum, string.Empty,
						int.MinValue, int.MinValue, int.MinValue, string.Empty, int.MinValue, int.MinValue,
						int.MinValue, string.Empty, int.MinValue, int.MinValue, int.MinValue, int.MinValue,
						String.Empty, DateTime.Now, String.Empty, DateTime.MinValue, parentAlbum != null ? parentAlbum.IsPrivate : false, false, videoFile, null)
        {
        }
开发者ID:Jiyuu,项目名称:galleryserverpro,代码行数:22,代码来源:Video.cs


示例5: FieldProblem_leftend

		public FieldProblem_leftend()
		{
            viewMock = MockRepository.Mock<IAddAlbumPresenter>();
            albumMock = MockRepository.Mock<IAlbum>();

            viewMock.ExpectEvent(x => x.Save += Arg<EventHandler<EventArgs>>.Is.NotNull);
		}
开发者ID:bytedreamer,项目名称:rhino-mocks,代码行数:7,代码来源:FieldProblem_leftend.cs


示例6: FieldProblem_leftend

        public FieldProblem_leftend()
        {
            viewMock = (IAddAlbumPresenter)MockRepository.GenerateMock(typeof(IAddAlbumPresenter), null, null);
            albumMock = MockRepository.GenerateStrictMock<IAlbum>();

            saveRaiser = viewMock.Expect(x => x.Save += null).IgnoreArguments().Constraints(Is.NotNull()).GetEventRaiser();
        }
开发者ID:alaendle,项目名称:rhino-mocks,代码行数:7,代码来源:FieldProblem_leftend.cs


示例7: ForTrack

        //public static IAlbum ForAlbum(int iTrackNumber=0)
        //{
        //    CompleteObservableCollectionImpl<ITrack> coci = new CompleteObservableCollectionImpl<ITrack>();
        //    IAlbum res = Substitute.For<IAlbum>();
        //    res.IsAlive.Returns(true);
        //    res.Tracks.Returns(coci);

        //    for (int i = 0; i < iTrackNumber; i++)
        //    {
        //        IInternalTrack subres = ForTrack(res);
        //    }
        //    return res;
        //}

        internal static IInternalTrack ForTrack(IAlbum Father)
        {
            IInternalTrack res = Substitute.For<IInternalTrack>();
            Father.Tracks.Add(res);
            res.Album.Returns(Father);
            res.IsAlive.Returns(true);
            return res;
        }
开发者ID:David-Desmaisons,项目名称:MusicCollection,代码行数:22,代码来源:SubstiteBuilder.cs


示例8: Album

 public Album(IAlbum album)
 {
     Artist = new Artist(album.Artist);
     CoverId = album.CoverId;
     Name = album.Name;
     Type = album.Type;
     Year = album.Year;
 }
开发者ID:thematlin,项目名称:Jukebox,代码行数:8,代码来源:Album.cs


示例9: AlbumViewer

        public AlbumViewer(IAlbum album)
        {
            InitializeComponent();
            _album = album;

            albumName.Text = _album.Name;
            musicList.Items.AddRange(_album.GetAllMusics().Select(p=>p.Name).ToArray());
        }
开发者ID:Sorcha,项目名称:SD-Trabalho1,代码行数:8,代码来源:AlbumViewer.cs


示例10: SaveCommit

 public void SaveCommit(IAlbum album, out bool success)
 {
     using (IUnitOfWork u = UnitOfWork.Begin())
     {
         Save(album, out success);
         if (success)
             u.Commit();
     }
 }
开发者ID:coredweller,项目名称:PhishMarket,代码行数:9,代码来源:AlbumService.cs


示例11: CopyGalleryObject

        /// <summary>
        /// Copy the specified object and place it in the specified destination album. This method creates a completely separate copy
        /// of the original, including copying the physical files associated with this object. The copy is persisted to the data
        /// store and then returned to the caller. When copying albums, all the album's children, grandchildren, etc are also copied.
        /// The audit fields of the copied objects are automatically updated before saving.
        /// </summary>
        /// <param name="galleryObjectToCopy">The gallery object to copy.</param>
        /// <param name="destinationAlbum">The album to which the current object should be copied.</param>
        /// <returns>
        /// Returns a new gallery object that is an exact copy of the original, except that it resides in the specified
        /// destination album, and of course has a new ID. Child objects are recursively copied.
        /// </returns>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="galleryObjectToCopy" /> is null.</exception>
        public static IGalleryObject CopyGalleryObject(IGalleryObject galleryObjectToCopy, IAlbum destinationAlbum)
        {
            if (galleryObjectToCopy == null)
                throw new ArgumentNullException("galleryObjectToCopy");

            string currentUser = Utils.UserName;

            return galleryObjectToCopy.CopyTo(destinationAlbum, currentUser);
        }
开发者ID:raquelsa,项目名称:GalleryServerProWeb,代码行数:22,代码来源:GalleryObjectController.cs


示例12: ConvertToDto

        public static Album ConvertToDto(IAlbum album)
        {
            using (album)
            {
                album.WaitUntilLoaded();

                return Mapper.Map<IAlbum, Album>(album);
            }
        }
开发者ID:torshy,项目名称:torshify-server,代码行数:9,代码来源:Convertion.cs


示例13: ViewPhotoForm

 /// <summary>
 /// Initializes a new instance of the <see cref="ViewPhotoForm"/> class.
 /// </summary>
 /// <param name="currentAlbum">The album whose photos the user is viewing.</param>
 /// <param name="photoToDisplay">the specific photo to view.</param>
 /// <remarks>
 /// Author(s): Miguel Gonzales and Andrea Tan
 /// </remarks>
 public ViewPhotoForm(IAlbum currentAlbum, IPhoto photoToDisplay)
 {
     this.InitializeComponent();
     this.album = currentAlbum;
     this.Text = this.album.AlbumId + " - Photo Buddy";
     this.allPhotosInAlbum = new List<IPhoto>(this.album.Photos);
     this.photoIndex = this.allPhotosInAlbum.IndexOf(photoToDisplay);
     this.DisplayPhoto(this.photoIndex);
 }
开发者ID:jamesrcounts,项目名称:CS441,代码行数:17,代码来源:ViewPhotoForm.cs


示例14: AlbumInformation

 public AlbumInformation(IAlbum album, Dispatcher dispatcher)
 {
     _tracks = new ObservableCollection<Track>();
     _copyrights = new ObservableCollection<string>();
     _dispatcher = dispatcher;
     _album = album;
     _browse = _album.Browse();
     _isLoading = !_browse.IsComplete;
     _browse.Completed += AlbumBrowseCompleted;
 }
开发者ID:kms,项目名称:torshify-client,代码行数:10,代码来源:AlbumInformation.cs


示例15: Album

        public Album(IAlbum album, Dispatcher dispatcher)
        {
            _dispatcher = dispatcher;
            InternalAlbum = album;

            _artist = new Lazy<Artist>(() => new Artist(InternalAlbum.Artist, dispatcher));
            _albumType = new Lazy<TorshifyAlbumType>(GetAlbumType);
            _name = new Lazy<string>(() => InternalAlbum.Name);
            _year = new Lazy<int>(() => InternalAlbum.Year);
        }
开发者ID:kms,项目名称:torshify-client,代码行数:10,代码来源:Album.cs


示例16: DeleteCommit

        public void DeleteCommit(IAlbum album)
        {
            Checks.Argument.IsNotNull(album, "album");

            using (IUnitOfWork u = UnitOfWork.Begin())
            {
                _repo.Remove(album);
                u.Commit();
            }
        }
开发者ID:coredweller,项目名称:PhishMarket,代码行数:10,代码来源:AlbumService.cs


示例17: MoveGalleryObject

		/// <summary>
		/// Move the specified object to the specified destination album. This method moves the physical files associated with this
		/// object to the destination album's physical directory. The object's Save() method is invoked to persist the changes to the
		/// data store. When moving albums, all the album's children, grandchildren, etc are also moved. 
		/// The audit fields are automatically updated before saving.
		/// </summary>
		/// <param name="galleryObjectToMove">The gallery object to move.</param>
		/// <param name="destinationAlbum">The album to which the current object should be moved.</param>
		public static void MoveGalleryObject(IGalleryObject galleryObjectToMove, IAlbum destinationAlbum)
		{
			string currentUser = Util.UserName;
			DateTime currentTimestamp = DateTime.Now;

			galleryObjectToMove.LastModifiedByUserName = currentUser;
			galleryObjectToMove.DateLastModified = currentTimestamp;

			galleryObjectToMove.MoveTo(destinationAlbum);
		}
开发者ID:haimon74,项目名称:KanNaim,代码行数:18,代码来源:GalleryObjectController.cs


示例18: FieldProblem_leftend

        public FieldProblem_leftend()
        {
            mocks = new MockRepository();
            viewMock =
                (IAddAlbumPresenter) mocks.DynamicMock(typeof (IAddAlbumPresenter));
            albumMock = mocks.StrictMock<IAlbum>();

            viewMock.Save += null;
            LastCall.IgnoreArguments().Constraints(Is.NotNull());
            saveRaiser = LastCall.GetEventRaiser();
        }
开发者ID:ChuangYang,项目名称:RhinoMocks,代码行数:11,代码来源:FieldProblem_leftend.cs


示例19: BrowseAsync

        public static Task<IAlbumBrowse> BrowseAsync(
            this ISession session,
            IAlbum album,
            object userState = null)
        {
            var tcs = new TaskCompletionSource<IAlbumBrowse>();

            var browse = session.Browse(album, userState);
            browse.Completed += (sender, args) => tcs.SetResult(browse);
            return tcs.Task;
        }
开发者ID:sekotin,项目名称:torshify,代码行数:11,代码来源:SessionExtensions.cs


示例20: PersistToFileSystemStore

		/// <summary>
		/// Update the directory on disk with the current name and location of the album. A new directory is
		/// created for new albums, and the directory is moved to the location specified by FullPhysicalPath if
		/// that property is different than FullPhysicalPathOnDisk.
		/// </summary>
		/// <param name="album">The album to persist to disk.</param>
		private static void PersistToFileSystemStore(IAlbum album)
		{
			if (album.IsNew)
			{
				System.IO.Directory.CreateDirectory(album.FullPhysicalPath);

				// Create directory for thumbnail cache, if needed.
				string thumbnailPath = HelperFunctions.MapAlbumDirectoryStructureToAlternateDirectory(album.FullPhysicalPath, AppSetting.Instance.ThumbnailPath);
				if (thumbnailPath != album.FullPhysicalPath)
				{
					System.IO.Directory.CreateDirectory(thumbnailPath);
				}

				// Create directory for optimized image cache, if needed.
				string optimizedPath = HelperFunctions.MapAlbumDirectoryStructureToAlternateDirectory(album.FullPhysicalPath, AppSetting.Instance.OptimizedPath);
				if (optimizedPath != album.FullPhysicalPath)
				{
					System.IO.Directory.CreateDirectory(optimizedPath);
				}
			}
			else if (album.FullPhysicalPathOnDisk != album.FullPhysicalPath)
			{
				// We need to move the directory to its new location or change its name. Verify that the containing directory doesn't already
				// have a directory with the new name. If it does, alter it slightly to make it unique.
				System.IO.DirectoryInfo di = System.IO.Directory.GetParent(album.FullPhysicalPath);

				string newDirName = HelperFunctions.ValidateDirectoryName(di.FullName, album.DirectoryName);
				if (album.DirectoryName != newDirName)
				{
					album.DirectoryName = newDirName;
				}

				// Now we are guaranteed to have a "safe" directory name, so proceed with the move/rename.
				System.IO.Directory.Move(album.FullPhysicalPathOnDisk, album.FullPhysicalPath);

				// Rename directory for thumbnail cache, if needed.
				string thumbnailPath = HelperFunctions.MapAlbumDirectoryStructureToAlternateDirectory(album.FullPhysicalPath, AppSetting.Instance.ThumbnailPath);
				if (thumbnailPath != album.FullPhysicalPath)
				{
					string currentThumbnailPath = HelperFunctions.MapAlbumDirectoryStructureToAlternateDirectory(album.FullPhysicalPathOnDisk, AppSetting.Instance.ThumbnailPath);

					RenameDirectory(currentThumbnailPath, thumbnailPath);
				}

				// Rename directory for optimized image cache, if needed.
				string optimizedPath = HelperFunctions.MapAlbumDirectoryStructureToAlternateDirectory(album.FullPhysicalPath, AppSetting.Instance.OptimizedPath);
				if (optimizedPath != album.FullPhysicalPath)
				{
					string currentOptimizedPath = HelperFunctions.MapAlbumDirectoryStructureToAlternateDirectory(album.FullPhysicalPathOnDisk, AppSetting.Instance.OptimizedPath);

					RenameDirectory(currentOptimizedPath, optimizedPath);
				}
			}
		}
开发者ID:haimon74,项目名称:KanNaim,代码行数:60,代码来源:AlbumSaveBehavior.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IAlgorithm类代码示例发布时间:2022-05-24
下一篇:
C# IAggregateRoot类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap