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

C# Artist类代码示例

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

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



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


示例16: AddArtist

        public ActionResult AddArtist(ArtistModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    Artist artist = new Artist();
                    artist.ArtistId = model.yearDropDownId;
                    artist.ArtistFirstName = model.FirstName;
                    artist.ArtistLastName = model.LastName;

                    dataService.ArtistService.AddNew(artist);
                    ViewBag.ThankYou = model.FirstName + " " + model.LastName + " has been successfully added.";
                    return View("ThankYou");

                }
                catch (Exception e)
                {
                    ViewBag.ErrorMessage = e.InnerException;
                    return View("Error");

                }
            }
            else
            {
                ViewBag.ErrorMessage = "Invalid Model State";
                return View("Error");
            }
        }
开发者ID:ejp6976,项目名称:Collector,代码行数:29,代码来源:ArtistController.cs


示例17: 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


示例18: EntryForApiContract

		public EntryForApiContract(Artist artist, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, bool ssl, 
			EntryOptionalFields includedFields)
			: this(artist, languagePreference) {

			ArtistType = artist.ArtistType;			
			CreateDate = artist.CreateDate;
			Status = artist.Status;

			if (includedFields.HasFlag(EntryOptionalFields.MainPicture) && artist.Picture != null) {
				MainPicture = new EntryThumbForApiContract(new EntryThumb(artist, artist.PictureMime), thumbPersister, ssl);					
			}

			if (includedFields.HasFlag(EntryOptionalFields.Names)) {
				Names = artist.Names.Select(n => new LocalizedStringContract(n)).ToArray();				
			}

			if (includedFields.HasFlag(EntryOptionalFields.Tags)) {
				Tags = artist.Tags.Usages.Select(u => new TagUsageForApiContract(u)).ToArray();				
			}

			if (includedFields.HasFlag(EntryOptionalFields.WebLinks)) {
				WebLinks = artist.WebLinks.Select(w => new ArchivedWebLinkContract(w)).ToArray();				
			}

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


示例19: btnSubmit_Click

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ArtistEvent atd = new ArtistEvent();

            atd.EventID = Convert.ToInt32( ddlTourDate.SelectedValue );

            Artist art = new Artist();

            if (ddlArtist1.SelectedValue != unknownValue && !string.IsNullOrEmpty( ddlArtist1.SelectedValue ))
            {
                art = new Artist(ddlArtist1.SelectedValue);
                atd.ArtistID = art.ArtistID;
                atd.RankOrder = 1;
                atd.Create();

                if (ddlArtist2.SelectedValue != unknownValue && !string.IsNullOrEmpty(ddlArtist2.SelectedValue))
                {
                    art = new Artist(ddlArtist2.SelectedValue);
                    atd.ArtistID = art.ArtistID;
                    atd.RankOrder = 2;
                    atd.Create();

                    if (ddlArtist3.SelectedValue != unknownValue && !string.IsNullOrEmpty(ddlArtist3.SelectedValue))
                    {
                        art = new Artist(ddlArtist3.SelectedValue);
                        atd.ArtistID = art.ArtistID;
                        atd.ArtistID = Convert.ToInt32(ddlArtist3.SelectedValue);
                        atd.RankOrder = 3;
                        atd.Create();
                    }

                }

            }
        }
开发者ID:pakoito,项目名称:web,代码行数:35,代码来源:ArtistTD.aspx.cs


示例20: Create

		public void Create() {

			var result = queries.Create(newArtistContract);

			Assert.IsNotNull(result, "result");
			Assert.AreEqual("Tripshots", result.Name, "Name");

			artist = repository.Load(result.Id);

			Assert.IsNotNull(artist, "Artist was saved to repository");
			Assert.AreEqual("Tripshots", artist.DefaultName, "Name");
			Assert.AreEqual(ContentLanguageSelection.English, artist.Names.SortNames.DefaultLanguage, "Default language should be English");
			Assert.AreEqual(1, artist.WebLinks.Count, "Weblinks count");

			var archivedVersion = repository.List<ArchivedArtistVersion>().FirstOrDefault();

			Assert.IsNotNull(archivedVersion, "Archived version was created");
			Assert.AreEqual(artist, archivedVersion.Artist, "Archived version artist");
			Assert.AreEqual(ArtistArchiveReason.Created, archivedVersion.Reason, "Archived version reason");

			var activityEntry = repository.List<ActivityEntry>().FirstOrDefault();

			Assert.IsNotNull(activityEntry, "Activity entry was created");
			Assert.AreEqual(artist, activityEntry.EntryBase, "Activity entry's entry");
			Assert.AreEqual(EntryEditEvent.Created, activityEntry.EditEvent, "Activity entry event type");

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# AsExpression类代码示例发布时间:2022-05-24
下一篇:
C# Article类代码示例发布时间: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