static void Main(string[] args) { LanguageData.init(); AuthorData.init(); Console.WriteLine(LanguageData.languages[0].GetData()); Console.WriteLine(LanguageData.languages[2].GetData()); Console.WriteLine(AuthorData.authors[0].GetData()); Console.WriteLine(AuthorData.authors[2].GetData()); AccessoryLanguageData dataAccessory = new AccessoryLanguageData("Markup language", "W3C HTML 5.2"); ProgrammingLanguageData dataProgramming = new ProgrammingLanguageData("OOP", "static strong"); LanguageData.languages.Add((AuthorData.authors[2] as LanguageAuthorBase).CreateLanguage("NEW NAME", 2018, dataAccessory)); LanguageData.languages.Add((AuthorData.authors[3] as LanguageAuthorBase).CreateLanguage("NEW NAME", 2018, dataProgramming)); Console.Read(); }
public AccessoryLanguage InheritanceLanguage(AccessoryLanguage language, string languageName, int creationYear, AccessoryLanguageData data) { AccessoryLanguage inheritLanaguage = new AccessoryLanguage ( languageName: languageName == "" ? language.GetName() : languageName, creationYear: creationYear == 0 ? language.GetDate() : creationYear, formatType: data.formatType == "" ? language.GetFormatType() : data.formatType, standart: data.standart == "" ? language.GetStandart() : data.standart ); inheritLanaguage.parentLanguage = language; LanguageData.languages.Add(inheritLanaguage); return(inheritLanaguage); }
public ILanguage CreateLanguage(string languageName, int creationYear, AccessoryLanguageData data) { return(new AccessoryLanguage(languageName, creationYear, data.formatType, data.standart)); }