예제 #1
0
        static void AddContributorToComic(ComicBook comic, string contributorname, TypeOfContributor contributortype)
        {
            var contributor = contributors.FirstOrDefault(c => c.ContributorName == contributorname);

            if (contributor == null)
            {
                var newcontributor = new Contributor(contributorname, contributortype);
                contributors.Add(newcontributor);
                comic.AddConstributor(newcontributor);
            }
            else
            {
                comic.AddConstributor(contributor);
            }
        }
예제 #2
0
 /// <summary>
 /// New Contributor with selected values
 /// </summary>
 /// <param name="contributorname">Name of the contributor</param>
 /// <param name="contributortype">Type of the contributor</param>
 public Contributor(string contributorname, TypeOfContributor contributortype)
 {
     ContributorName = contributorname;
     ContributorType = contributortype;
 }