当前位置: 首页>>代码示例>>C#>>正文


C# Builder.OnDone方法代码示例

本文整理汇总了C#中Builder.OnDone方法的典型用法代码示例。如果您正苦于以下问题:C# Builder.OnDone方法的具体用法?C# Builder.OnDone怎么用?C# Builder.OnDone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Builder的用法示例。


在下文中一共展示了Builder.OnDone方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BasicTag

        public void BasicTag ()
        {
            var builder = new Builder ();
            builder.OnTag (new Tag {
                Title = "Foo Bar",
                Track = 42
            });
            var objects = builder.OnDone ();

            var music_track = objects[0] as MusicTrack;
            Assert.AreEqual ("Foo Bar", music_track.Title);
            Assert.AreEqual (42, music_track.OriginalTrackNumber);
        }
开发者ID:pacificIT,项目名称:mono-upnp,代码行数:13,代码来源:Wmp11MusicBuilderTests.cs

示例2: BasicGenreTag

        public void BasicGenreTag ()
        {
            var builder = new Builder ();

            builder.OnTag (new Tag {
                Title = "Foo Bar",
                Track = 42,
                Genres = new[] { "Bat" },
            });

            var objects = builder.OnDone ();

            var music_track = objects[0] as MusicTrack;
            Assert.AreEqual ("Foo Bar", music_track.Title);
            Assert.AreEqual (42, music_track.OriginalTrackNumber);
            Assert.AreEqual ("Bat", music_track.Genres[0]);

            var reference = objects[1] as Item;
            Assert.AreEqual (music_track.Id, reference.RefId);

            var music_genre = objects[3] as MusicGenre;
            Assert.AreEqual ("Bat", music_genre.Title);
            Assert.AreEqual (1, music_genre.ChildCount);
        }
开发者ID:pacificIT,项目名称:mono-upnp,代码行数:24,代码来源:Wmp11MusicBuilderTests.cs

示例3: BasicArtistAndGenreTag

        public void BasicArtistAndGenreTag ()
        {
            var builder = new Builder ();

            builder.OnTag (new Tag {
                Title = "Foo Bar",
                Track = 42,
                Performers = new[] { "Boo Far" },
                Genres = new[] { "Bat" }
            });

            var objects = builder.OnDone ();

            var music_track = objects[0] as MusicTrack;
            Assert.AreEqual ("Foo Bar", music_track.Title);
            Assert.AreEqual (42, music_track.OriginalTrackNumber);
            Assert.AreEqual ("Boo Far", music_track.Artists[0].Name);
            Assert.AreEqual ("Bat", music_track.Genres[0]);

            Assert.AreEqual (music_track.Id, ((Item)objects[1]).RefId);
            Assert.AreEqual (music_track.Id, ((Item)objects[2]).RefId);

            var music_genre = objects[4] as MusicGenre;
            Assert.AreEqual ("Bat", music_genre.Title);
            Assert.AreEqual (1, music_genre.ChildCount);

            var music_artist = objects[6] as MusicArtist;
            Assert.AreEqual ("Boo Far", music_artist.Title);
            Assert.AreEqual (1, music_artist.ChildCount);
            Assert.AreEqual ("Bat", music_artist.Genres[0]);
        }
开发者ID:pacificIT,项目名称:mono-upnp,代码行数:31,代码来源:Wmp11MusicBuilderTests.cs

示例4: MultipleArtistAndGenreTags

        public void MultipleArtistAndGenreTags ()
        {
            var builder = new Builder ();

            builder.OnTag (new Tag {
                Title = "Foo Bar",
                Track = 42,
                Performers = new[] { "Boo Far" },
                Genres = new[] { "Bazz" }
            });

            builder.OnTag (new Tag {
                Title = "Hurt",
                Track = 1,
                Performers = new[] { "Our Lady J" },
                Genres = new[] { "Bazz", "Electro Gospel" }
            });

            var objects = builder.OnDone ();

            var music_track = objects[0] as MusicTrack;
            Assert.AreEqual ("Foo Bar", music_track.Title);
            Assert.AreEqual (42, music_track.OriginalTrackNumber);
            Assert.AreEqual ("Boo Far", music_track.Artists[0].Name);
            Assert.AreEqual ("Bazz", music_track.Genres[0]);

            Assert.AreEqual (music_track.Id, ((Item)objects[1]).RefId);
            Assert.AreEqual (music_track.Id, ((Item)objects[2]).RefId);

            music_track = objects[3] as MusicTrack;
            Assert.AreEqual ("Hurt", music_track.Title);
            Assert.AreEqual (1, music_track.OriginalTrackNumber);
            Assert.AreEqual ("Our Lady J", music_track.Artists[0].Name);
            Assert.AreEqual ("Bazz", music_track.Genres[0]);
            Assert.AreEqual ("Electro Gospel", music_track.Genres[1]);

            Assert.AreEqual (music_track.Id, ((Item)objects[4]).RefId);
            Assert.AreEqual (music_track.Id, ((Item)objects[5]).RefId);
            Assert.AreEqual (music_track.Id, ((Item)objects[6]).RefId);

            var music_genre = objects[8] as MusicGenre;
            Assert.AreEqual ("Bazz", music_genre.Title);
            Assert.AreEqual (2, music_genre.ChildCount);

            music_genre = objects[9] as MusicGenre;
            Assert.AreEqual ("Electro Gospel", music_genre.Title);
            Assert.AreEqual (1, music_genre.ChildCount);

            var music_artist = objects[11] as MusicArtist;
            Assert.AreEqual ("Boo Far", music_artist.Title);
            Assert.AreEqual (1, music_artist.ChildCount);
            Assert.AreEqual ("Bazz", music_artist.Genres[0]);

            music_artist = objects[12] as MusicArtist;
            Assert.AreEqual ("Our Lady J", music_artist.Title);
            Assert.AreEqual (1, music_artist.ChildCount);
            Assert.AreEqual ("Bazz", music_artist.Genres[0]);
            Assert.AreEqual ("Electro Gospel", music_artist.Genres[1]);
        }
开发者ID:pacificIT,项目名称:mono-upnp,代码行数:59,代码来源:Wmp11MusicBuilderTests.cs

示例5: MultipleGenresTag

        public void MultipleGenresTag ()
        {
            var builder = new Builder ();

            builder.OnTag (new Tag {
                Title = "Foo Bar",
                Track = 42,
                Genres = new[] { "Bat", "Baz" },
            });

            var objects = builder.OnDone ();

            var music_track = objects[0] as MusicTrack;
            Assert.AreEqual ("Foo Bar", music_track.Title);
            Assert.AreEqual (42, music_track.OriginalTrackNumber);
            Assert.AreEqual ("Bat", music_track.Genres[0]);
            Assert.AreEqual ("Baz", music_track.Genres[1]);

            Assert.AreEqual (music_track.Id, ((Item)objects[1]).RefId);
            Assert.AreEqual (music_track.Id, ((Item)objects[2]).RefId);

            var music_genre = objects[4] as MusicGenre;
            Assert.AreEqual ("Bat", music_genre.Title);
            Assert.AreEqual (1, music_genre.ChildCount);

            music_genre = objects[5] as MusicGenre;
            Assert.AreEqual ("Baz", music_genre.Title);
            Assert.AreEqual (1, music_genre.ChildCount);
        }
开发者ID:pacificIT,项目名称:mono-upnp,代码行数:29,代码来源:Wmp11MusicBuilderTests.cs


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