本文整理汇总了C#中Person.InvertName方法的典型用法代码示例。如果您正苦于以下问题:C# Person.InvertName方法的具体用法?C# Person.InvertName怎么用?C# Person.InvertName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person.InvertName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillPropertiesLight
protected override void FillPropertiesLight(string xml)
{
base.FillPropertiesLight(xml);
var xmlDoc = XDocument.Parse(xml);
if (xmlDoc.Root != null)
{
var nodes = xmlDoc.Root.Descendants();
//Composer
var nationality = GetVarfield(nodes, "100", "j");
string nationalityLookupValue = null;
if (nationality != null)
NationalityDictionary.TryGetValue(nationality, out nationalityLookupValue);
Composer = new Person
{
Name = GetVarfield(nodes, "100", "a"),
LivingYears = GetVarfield(nodes, "100", "d"),
Nationality = nationalityLookupValue ?? nationality,
Role = "Composer"
};
if (Composer.Name != null)
Composer.InvertName(Composer.Name);
MainResponsible = Composer;
}
}
示例2: FillPropertiesLight
protected override void FillPropertiesLight(string xml)
{
base.FillPropertiesLight(xml);
var xmlDoc = XDocument.Parse(xml);
if (xmlDoc.Root != null)
{
var nodes = xmlDoc.Root.Descendants("oai_marc");
var nationality = GetVarfield(nodes, "100", "j");
string nationalityLookupValue = null;
if (nationality != null)
NationalityDictionary.TryGetValue(nationality, out nationalityLookupValue);
Author = new Person
{
Name = GetVarfield(nodes, "100", "a"),
LivingYears = GetVarfield(nodes, "100", "d"),
Nationality = nationalityLookupValue ?? nationality,
Role = "Author"
};
string tempName = GetVarfield(nodes, "100", "a");
if (tempName != null)
Author.InvertName(tempName);
//If N/A, check BSMARC field 110 for author
if (Author.Name == null)
{
Author.Name = GetVarfield(nodes, "110", "a");
}
}
}
示例3: FillPropertiesLight
protected override void FillPropertiesLight(string xml)
{
base.FillPropertiesLight(xml);
var xmlDoc = XDocument.Parse(xml);
if (xmlDoc.Root != null)
{
var nodes = xmlDoc.Root.Descendants("oai_marc");
Isbn = GetVarfield(nodes, "020", "a");
//Author, check BSMARC field 100 for author
var nationality = GetVarfield(nodes, "100", "j");
string nationalityLookupValue = null;
if (nationality != null)
NationalityDictionary.TryGetValue(nationality, out nationalityLookupValue);
Author = new Person
{
Name = GetVarfield(nodes, "100", "a"),
LivingYears = GetVarfield(nodes, "100", "d"),
Nationality = nationalityLookupValue ?? nationality,
Role = "Author"
};
//If N/A, check BSMARC field 110 for author
if (Author.Name == null)
{
Author.Name = GetVarfield(nodes, "110", "a");
//Organization (110abq)
Organization = GenerateOrganizationsFromXml(nodes, "110").FirstOrDefault();
}
//If still N/A, check BSMARC field 130 for title when title is main scheme word
if (Author.Name == null)
StandarizedTitle = GetVarfield(nodes, "130", "a");
if (Author.Name != null)
Author.InvertName(Author.Name);
MainResponsible = Author;
PartTitle = GetVarfield(nodes, "245", "p");
if (Title != null && PartTitle != null)
{
Title = Title + " : " + PartTitle;
}
}
}
示例4: FillProperties
protected override void FillProperties(string xml)
{
base.FillProperties(xml);
var xmlDoc = XDocument.Parse(xml);
if (xmlDoc.Root != null)
{
var nodes = xmlDoc.Root.Descendants();
Ean = GetVarfield(nodes, "025", "a");
//Each subtitlelanguage is given as a 3-char long code, all put together to one string
var subtitles = GetVarfield(nodes, "041", "b").SplitByLength(3).ToList();
for (var i = 0; i < subtitles.Count(); i++)
{
string subtitleLookupValue = null;
LanguageDictionary.TryGetValue(subtitles[i], out subtitleLookupValue);
subtitles[i] = subtitleLookupValue ?? subtitles[i];
}
SubtitleLanguage = subtitles;
OriginalTitle = GetVarfield(nodes, "240", "a");
Numbering = GetVarfield(nodes, "245", "n");
PartTitle = GetVarfield(nodes, "245", "p");
Edition = GetVarfield(nodes, "250", "a");
ProductionYear = GetVarfield(nodes, "260", "g");
TypeAndNumberOfDiscs = GetVarfield(nodes, "300", "a");
Contents = GetVarfield(nodes, "505", "a");
var actorsString = GetVarfield(nodes, "511", "a");
var persons = new List<Person>();
if (actorsString != null)
{
var actorsList = actorsString.Split(':');
if (actorsList.Length > 1)
{
actorsList = actorsList[1].Split(',');
}
foreach (string personName in actorsList)
{
var p = new Person();
p.Name = personName.Trim();
p.InvertName(p.Name);
persons.Add(p);
}
}
Actors = persons;
AgeLimit = GetVarfield(nodes, "521", "a");
NorwegianTitle = GetVarfield(nodes, "572", "a");
ReferredPersons = GeneratePersonsFromXml(nodes, "600");
ReferredOrganizations = GenerateOrganizationsFromXml(nodes, "610");
Subject = GetVarfield(nodes, "650", "a");
ReferencedPlaces = GetVarfieldAsList(nodes, "651", "a");
CompositionType = GetVarfield(nodes, "652", "a");
Genre = GetVarfieldAsList(nodes, "655", "a");
InvolvedOrganizations = GenerateOrganizationsFromXml(nodes, "710");
}
}
示例5: GeneratePersonsFromXml
protected static IEnumerable<Person> GeneratePersonsFromXml(IEnumerable<XElement> nodes, string id)
{
var persons = new List<Person>();
var varfields = nodes.Elements("varfield").Where(x => ((string)x.Attribute("id")).Equals(id)).ToList();
foreach (var varfield in varfields)
{
var nationality = GetSubFieldValue(varfield, "j");
string nationalityLookupValue = null;
if (nationality != null)
NationalityDictionary.TryGetValue(nationality, out nationalityLookupValue);
var role = GetSubFieldValue(varfield, "e");
string roleLookupValue = null;
if (role != null)
RoleDictionary.TryGetValue(role, out roleLookupValue);
var person = new Person()
{
Name = GetSubFieldValue(varfield, "a"),
LivingYears = GetSubFieldValue(varfield, "d"),
Nationality = nationalityLookupValue ?? nationality,
Role = roleLookupValue ?? role,
ReferredWork = GetSubFieldValue(varfield, "t")
};
string tempName = GetSubFieldValue(varfield, "a");
if (tempName != null)
person.InvertName(tempName);
if (!string.IsNullOrEmpty(person.Name) && !persons.Any(x => x.Name.Equals(person.Name)))
{
persons.Add(person);
}
}
return persons;
}
示例6: FillPropertiesLight
protected override void FillPropertiesLight(string xml)
{
base.FillPropertiesLight(xml);
var xmlDoc = XDocument.Parse(xml);
if (xmlDoc.Root != null)
{
var nodes = xmlDoc.Root.Descendants("oai_marc");
//ArtistOrComposer, check BSMARC field 100
var nationality = GetVarfield(nodes, "100", "j");
string nationalityLookupValue = null;
if (nationality != null)
NationalityDictionary.TryGetValue(nationality, out nationalityLookupValue);
ArtistOrComposer = new Person
{
Name = GetVarfield(nodes, "100", "a"),
LivingYears = GetVarfield(nodes, "100", "d"),
Nationality = nationalityLookupValue ?? nationality,
Role = "ArtistOrComposer"
};
MainResponsible = ArtistOrComposer;
//If no ArtistOrCompose, check BSMARC field 110 for MusicGroup
if (ArtistOrComposer.Name == null)
{
MusicGroup = GetVarfield(nodes, "110", "a");
ExplanatoryAddition = GetVarfield(nodes, "110", "q");
MainResponsible = MusicGroup;
}
if (ArtistOrComposer.Name != null)
ArtistOrComposer.InvertName(ArtistOrComposer.Name);
}
}