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


C# Artist类代码示例

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


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

示例1: WhereHasArtistParticipationStatus

		public static IQueryable<ArtistForAlbum> WhereHasArtistParticipationStatus(this IQueryable<ArtistForAlbum> query, Artist artist, ArtistAlbumParticipationStatus participation) {

			if (participation == ArtistAlbumParticipationStatus.Everything || artist == null)
				return query;

			var musicProducerTypes = new[] {ArtistType.Producer, ArtistType.Circle, ArtistType.OtherGroup};

			if (musicProducerTypes.Contains(artist.ArtistType)) {

				var producerRoles = ArtistRoles.Composer | ArtistRoles.Arranger;

				switch (participation) {
					case ArtistAlbumParticipationStatus.OnlyMainAlbums:
						return query.Where(a => !a.IsSupport && ((a.Roles == ArtistRoles.Default) || ((a.Roles & producerRoles) != ArtistRoles.Default)) && a.Album.ArtistString.Default != ArtistHelper.VariousArtists);
					case ArtistAlbumParticipationStatus.OnlyCollaborations:
						return query.Where(a => a.IsSupport || ((a.Roles != ArtistRoles.Default) && ((a.Roles & producerRoles) == ArtistRoles.Default)) || a.Album.ArtistString.Default == ArtistHelper.VariousArtists);
					default:
						return query;
				}

			} else {

				switch (participation) {
					case ArtistAlbumParticipationStatus.OnlyMainAlbums:
						return query.Where(a => !a.IsSupport);
					case ArtistAlbumParticipationStatus.OnlyCollaborations:
						return query.Where(a => a.IsSupport);
					default:
						return query;
				}
				
			}

		}
开发者ID:realzhaorong,项目名称:vocadb,代码行数:34,代码来源:ArtistForAlbumQueryableExtender.cs

示例2: ArtistWithArchivedVersionsContract

        public ArtistWithArchivedVersionsContract(Artist artist, ContentLanguagePreference languagePreference)
            : base(artist, languagePreference)
        {
            ParamIs.NotNull(() => artist);

            ArchivedVersions = artist.ArchivedVersionsManager.Versions.Select(a => new ArchivedArtistVersionContract(a)).ToArray();
        }
开发者ID:realzhaorong,项目名称:vocadb,代码行数:7,代码来源:ArtistWithArchivedVersions.cs

示例3: HomeModule

        public HomeModule()
        {
            Get["/"] = _ => {
            var allCDs = CD.GetAllCDs();
            return View["index.cshtml", allCDs];
              };
            // view the mainpage, taking all the CDs as model
            Get["/cd/new"] = _ => {
            return View["addCD.cshtml"];
            };
            //if you get CD/new, take to add CD form//
            Post["/cdAdded"] = _ => {
             var newCD = new CD(Request.Form["cd-title"], Request.Form["cd-artist"], Request.Form["cd-year"], Request.Form["cd-cover"]);
             var newArtist = new Artist(Request.Form["cd-artist"]);
             newArtist.AddArtistCD(newCD);
             return View["cdAdded.cshtml", newCD];
               };

               Get["/searchbyartist"] = _ => {
             return View["searchByArtist.cshtml"];
               };

               Post["/searchresults"] = _ => {
            var selectedArtist = Artist.Find(Request.Form["artist-name"]);
            List<CD> resultCDs = selectedArtist.GetAllArtistsCDs();
            return View["searchResults.cshtml", resultCDs];
              };
        }
开发者ID:veronica-aubry,项目名称:CDOrganizer,代码行数:28,代码来源:HomeModule.cs

示例4: ArtistViewModel

 public ArtistViewModel(Artist a)
     : base(a)
 {
     artist = a;
     TypeImage = "\xe13d";
     InitLogo(string.Format("artist_{0}.jpg", Id));
 }
开发者ID:akakoori,项目名称:xiami_downloader,代码行数:7,代码来源:ArtistViewModel.cs

示例5: AddOwnedArtist_AlreadyAdded

        public void AddOwnedArtist_AlreadyAdded()
        {
            var artist = new Artist { Id = 1 };

            user.AddOwnedArtist(artist);
            user.AddOwnedArtist(artist);
        }
开发者ID:realzhaorong,项目名称:vocadb,代码行数:7,代码来源:UserTests.cs

示例6: AddArtist

   public int AddArtist(ArtistLite al)
   {
       int result = 1;
       Artist a = new Artist();
       a.ArtistName = al.ArtistName;
       a.ArtistEmail = al.Email;
       a.ArtistWebPage = al.WebPage;
       a.ArtistDateEntered = DateTime.Now;


       try
       {

           st.Artists.Add(a);
           st.SaveChanges();
       }
       catch (Exception ex)
       {
           result = 0;
           throw ex;
       }

       return result;
      
   }
开发者ID:Atiagina,项目名称:VenueRegistrationService,代码行数:25,代码来源:VenueRegistrationService.cs

示例7: addArtistButton_Click

        private void addArtistButton_Click(object sender, System.EventArgs e)
        {
            var repository = new CDCatalogRepository();
            var formHelper = new FormHelper();

            if (!formHelper.TextBoxHasContents(addArtistTxtBoxArtistName))
            {
                MessageBox.Show("Please enter an artist name.", "Input validation error");
                addArtistTxtBoxArtistName.Focus();
            }
            else
            {
                var newArtist = addArtistTxtBoxArtistName.Text.Trim();
                var artists = repository.SearchArtistByArtistNameExclusive(newArtist);

                if (artists.Count > 0)
                {
                    MessageBox.Show("You wanted to add " + newArtist + ", but " + artists[0].ArtistName + " already exsists.", "Artist must be unique");
                    addArtistTxtBoxArtistName.Focus();
                }
                else
                {
                    CreatedArtist = repository.CreateArtist(addArtistTxtBoxArtistName.Text.Trim());
                    this.Close();
                }
            }
        }
开发者ID:dgreer7,项目名称:CDCatalog,代码行数:27,代码来源:AddArtist.cs

示例8: EntryRefWithCommonPropertiesContract

		public EntryRefWithCommonPropertiesContract(Artist entry, ContentLanguagePreference languagePreference)
			: base(entry, languagePreference) {

			ArtistString = null;
			EntryTypeName = ArtistTypeNames.ResourceManager.GetString(entry.ArtistType.ToString());

		}
开发者ID:realzhaorong,项目名称:vocadb,代码行数:7,代码来源:EntryRefWithCommonPropertiesContract.cs

示例9: ArtistForUser

		public ArtistForUser(User user, Artist artist)
			: this() {

			User = user;
			Artist = artist;

		}
开发者ID:realzhaorong,项目名称:vocadb,代码行数:7,代码来源:ArtistForUser.cs

示例10: PlayListElems

 public PlayListElems(Artist aid, Album alid, TrackList trid)
 {
     ArtistName = (string)aid.ArtistName;
     AlbumName = (string)alid.AlbumName;
     TrackNum = (string)trid.TrackNum;
     TrackName = (string)trid.TrackName;
 }
开发者ID:Apolotary,项目名称:GinTunes,代码行数:7,代码来源:PlayListElems.cs

示例11: SetUp

		public void SetUp() {

			artist = CreateEntry.Producer(name: "Tripshots");
			repository = new FakeArtistRepository(artist);

			foreach (var name in artist.Names)
				repository.Save(name);

			user = CreateEntry.User(name: "Miku");
			repository.Save(user);
			permissionContext = new FakePermissionContext(user);
			imagePersister = new InMemoryImagePersister();

			queries = new ArtistQueries(repository, permissionContext, new FakeEntryLinkFactory(), imagePersister, MemoryCache.Default);

			newArtistContract = new CreateArtistContract {
				ArtistType = ArtistType.Producer,
				Description = string.Empty,
				Names = new[] {
					new LocalizedStringContract("Tripshots", ContentLanguageSelection.English)
				},
				WebLink = new WebLinkContract("http://tripshots.net/", "Website", WebLinkCategory.Official)
			};

		}
开发者ID:realzhaorong,项目名称:vocadb,代码行数:25,代码来源:ArtistQueriesTests.cs

示例12: Save

        public Artist Save(Artist artist)
        {
            Artist artistDB = null;
            if (artist == null)
            {
                throw new ArgumentException("Cannot save null artist");
            }
            try
            {
                StartTx();
                if (artist.Id == null)
                {
                    artistDB = artistDao.Persist(artist);
                }
                else
                {
                    artistDB = artistDao.ById(artist.Id);
                    if (artistDB.Deleted)
                    {
                        throw new EntityNotFoundException();
                    }
                    artistDB = artistDao.Update(artist);
                }
                CommitTx();
            }
            catch (Exception e)
            {
                RollbackTx();
                throw e;
            }

            return artistDB;
        }
开发者ID:FH-Thomas-Herzog,项目名称:SemesterProject1516,代码行数:33,代码来源:ArtistService.cs

示例13: ArtistReport

		public ArtistReport(Artist artist, ArtistReportType reportType, User user, string hostname, string notes)
			: base(user, hostname, notes) {

			Artist = artist;
			ReportType = reportType;

		}
开发者ID:realzhaorong,项目名称:vocadb,代码行数:7,代码来源:ArtistReport.cs

示例14: PutArtist

        public IHttpActionResult PutArtist(int id, Artist artist)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != artist.ArtistId)
            {
                return BadRequest();
            }

            //db.Entry(artist).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ArtistExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
开发者ID:danielyaakove,项目名称:MusicStore,代码行数:32,代码来源:ArtistsController.cs

示例15: CreateArtist

		private IArtistWithSupport CreateArtist(ArtistType artistType, string name) {

			var p = new Artist { ArtistType = artistType };
			p.Names.Add(new ArtistName(p, new LocalizedString(name, ContentLanguageSelection.English)));
			return p.AddAlbum(new Album());

		}
开发者ID:realzhaorong,项目名称:vocadb,代码行数:7,代码来源:ArtistHelperTests.cs


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