本文整理汇总了C#中XmlDbRow.GetStringList方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDbRow.GetStringList方法的具体用法?C# XmlDbRow.GetStringList怎么用?C# XmlDbRow.GetStringList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlDbRow
的用法示例。
在下文中一共展示了XmlDbRow.GetStringList方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public override void Parse(XmlDbRow row)
{
base.Parse(row);
mMinIntensityDuration = row.GetFloat("MinIntensityDuration", 0);
mTransitionTime.First = row.GetFloat("MinTransitionTime", 0);
mTransitionTime.Second = row.GetFloat("MaxTransitionTime", 0);
mIntensityWeights = new List<int>();
mIntensityWeights.Add(row.GetInt("LightWeight", 0));
mIntensityWeights.Add(row.GetInt("ModerateWeight", 0));
mIntensityWeights.Add(row.GetInt("HeavyWeight", 0));
mIntensityChangeWeights = new List<int>();
foreach (string strValue in row.GetStringList("NumIntensityChangeWeights", ','))
{
float value;
if (float.TryParse(strValue, out value))
{
mIntensityChangeWeights.Add((int)value);
}
else
{
mIntensityChangeWeights.Add(0);
}
}
}
示例2: MoodletTest
public MoodletTest(XmlDbRow row)
{
string name = row.GetString("GUID");
if (!row.Exists("BuffName"))
{
BooterLogger.AddError(name + " BuffName Missing");
}
else
{
foreach (string buffStr in row.GetStringList("BuffName", ','))
{
BuffNames buff;
if (ParserFunctionsEx.Parse(buffStr, out buff))
{
mBuffs.Add(buff);
}
else
{
BooterLogger.AddError(name + " Unknown BuffName: " + buffStr);
}
}
}
if (row.Exists("Origin"))
{
foreach (string originStr in row.GetStringList("Origin", ','))
{
Origin origin;
if (ParserFunctionsEx.Parse(originStr, out origin))
{
mOrigins.Add(origin);
}
else
{
BooterLogger.AddError(name + " Unknown Origin: " + origin);
}
mOrigins.Add(origin);
}
}
}
示例3: WeightedStage
public WeightedStage(XmlDbRow row)
: base(row)
{
if (!BooterLogger.Exists(row, "NextStages", Name)) return;
if (!BooterLogger.Exists(row, "NextWeights", Name)) return;
List<string> nextStages = row.GetStringList("NextStages", ',');
List<string> nextWeights = row.GetStringList("NextWeights", ',');
if (nextStages.Count != nextWeights.Count)
{
BooterLogger.AddError(Name + " NextStages/NextWeights Size Mismatch");
mNextStages = new Pair<string, int>[] { new Pair<string, int> ("", 0) };
mNextWeights = new int[] { 1 };
return;
}
mNextStages = new Pair<string, int>[nextStages.Count];
mNextWeights = new int[nextWeights.Count];
for (int i = 0; i < nextStages.Count; i++)
{
mNextStages[i].First = nextStages[i];
if (!int.TryParse(nextWeights[i], out mNextWeights[i]))
{
BooterLogger.AddError(Name + " NextWeights not numeric: " + nextWeights[i]);
return;
}
}
foreach (int weight in mNextWeights)
{
mTotalWeight += weight;
}
}
示例4: GenericTest
public GenericTest(XmlDbRow row)
{
string name = row.GetString("GUID");
foreach (string e in row.GetStringList("Event", ','))
{
EventTypeId id;
if (!ParserFunctions.TryParseEnum<EventTypeId>(e, out id, EventTypeId.kEventNone))
{
BooterLogger.AddError(name + " Unknown Event: " + e);
}
mEvents.Add(id);
}
}
示例5: SocialTest
public SocialTest(XmlDbRow row)
{
string name = row.GetString("GUID");
if (BooterLogger.Exists(row, "Socials", name))
{
mSocials = row.GetStringList("SocialName", ',');
for (int i = mSocials.Count - 1; i >= 0; i--)
{
if (ActionData.Get(mSocials[i]) == null)
{
BooterLogger.AddError(name + " Invalid Social: " + mSocials[i]);
mSocials.RemoveAt(i);
}
}
}
if (BooterLogger.Exists(row, "AllowAccept", name))
{
mAllowAccept = row.GetBool("AllowAccept");
}
if (BooterLogger.Exists(row, "AllowReject", name))
{
mAllowReject = row.GetBool("AllowReject");
}
if (BooterLogger.Exists(row, "AllowRecipient", name))
{
mAllowRecipient = row.GetBool("AllowRecipient");
}
if (BooterLogger.Exists(row, "AllowInitiator", name))
{
mAllowInitiator = row.GetBool("AllowInitiator");
}
}
示例6: Perform
protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
{
string guid = row.GetString("Guid");
if (string.IsNullOrEmpty(guid))
{
BooterLogger.AddError(file + ": Guid empty");
return;
}
AfterschoolActivityType type = unchecked((AfterschoolActivityType)ResourceUtils.HashString64(guid));
AfterschoolActivityData data = new AfterschoolActivityData();
data.mActivity = new AfterschoolActivity(type);
List<string> skills = row.GetStringList("Skills", ',');
if (skills != null)
{
foreach (string skillStr in skills)
{
SkillNames skill = SkillManager.sSkillEnumValues.ParseEnumValue(skillStr);
if (skill == SkillNames.None)
{
BooterLogger.AddError(file + ": " + guid + " Unknown skill " + skillStr);
return;
}
else
{
data.mActivity.ActivitySkillNameList.Add(skill);
}
}
}
if (data.mActivity.ActivitySkillNameList.Count == 0)
{
BooterLogger.AddError(file + ": " + guid + " Activity Must Have a Skill");
return;
}
DaysOfTheWeek days;
if (!row.TryGetEnum<DaysOfTheWeek>("DaysOfTheWeek", out days, DaysOfTheWeek.All))
{
BooterLogger.AddError(file + ": " + guid + " Unknown DaysOfTheWeek " + row.GetString("DaysOfTheWeek"));
return;
}
data.mActivity.DaysForActivity = days;
CASAgeGenderFlags genders;
if (!row.TryGetEnum<CASAgeGenderFlags>("Genders", out genders, CASAgeGenderFlags.GenderMask))
{
BooterLogger.AddError(file + ": " + guid + " Unknown Genders " + row.GetString("Genders"));
return;
}
data.mGenders = genders;
CASAgeGenderFlags ages;
if (!row.TryGetEnum<CASAgeGenderFlags>("Ages", out ages, CASAgeGenderFlags.AgeMask))
{
BooterLogger.AddError(file + ": " + guid + " Unknown Ages " + row.GetString("Ages"));
return;
}
data.mAges = ages;
if (row.Exists("PreLoop"))
{
data.mPreLoop = new Common.MethodStore(row.GetString("PreLoop"), new Type[] { typeof(GoToSchoolInRabbitHole), typeof(AfterschoolActivity) }).Method;
if (data.mPreLoop == null)
{
BooterLogger.AddError(file + ": " + guid + " Missing PreLoop " + row.GetString("PreLoop"));
return;
}
}
if (row.Exists("Loop"))
{
data.mLoop = new Common.MethodStore(row.GetString("Loop"), new Type[] { typeof(GoToSchoolInRabbitHole), typeof(AfterschoolActivity) }).Method;
if (data.mLoop == null)
{
BooterLogger.AddError(file + ": " + guid + " Missing Loop " + row.GetString("Loop"));
return;
}
}
if (row.Exists("PostLoop"))
{
data.mPostLoop = new Common.MethodStore(row.GetString("PostLoop"), new Type[] { typeof(GoToSchoolInRabbitHole), typeof(AfterschoolActivity) }).Method;
if (data.mPostLoop == null)
{
BooterLogger.AddError(file + ": " + guid + " Missing PostLoop " + row.GetString("PostLoop"));
return;
}
}
Activities.Add(type, data);
BooterLogger.AddTrace(file + ": " + guid + " Loaded");
}
示例7: ParseRewards
public static ArrayList ParseRewards(XmlDbRow dr, string[] columnKeys, int numRewards)
{
try
{
ArrayList list = new ArrayList();
for (int i = 0; i < numRewards; i++)
{
bool flag = false;
List<string> entry = dr.GetStringList(columnKeys[i], ',', false);
if (entry.Count > 0)
{
RewardType type;
for (int j = 0; j < entry.Count; j++)
{
entry[j] = entry[j].Trim();
}
if (ParserFunctions.TryParseEnum<RewardType>(entry[0], out type, RewardType.Undefined))
{
RewardInfo info = null;
switch (type)
{
case RewardType.BookSkill:
info = RewardsManager.ParseBookSkillRewardInfo(entry);
flag = info != null;
break;
case RewardType.Buff:
info = RewardsManager.ParseBuffRewardInfo(entry);
flag = info != null;
break;
case RewardType.CareerDemotion:
case RewardType.CareerFired:
case RewardType.CareerPromotion:
case RewardType.UnknownRecipe:
case RewardType.UnlearnedComposition:
case RewardType.CompedMeal:
case RewardType.BookQualityIncrease:
case RewardType.ConcertsPerformed:
info = new RewardInfo();
info.mType = type;
flag = true;
break;
case RewardType.Ingredient:
info = RewardsManager.ParseIngredientRewardInfo(entry);
flag = info != null;
break;
case RewardType.Money:
info = RewardsManager.ParseMoneyRewardInfo(entry);
flag = info != null;
break;
case RewardType.RandomGroupMeal:
info = RewardsManager.ParseRandomGroupMealRewardInfo(entry);
flag = info != null;
break;
case RewardType.RandomPlantable:
info = RewardsManager.ParseRandomPlantableRewardInfo(entry);
flag = info != null;
break;
case RewardType.RandomObject:
info = RewardsManager.ParseRandomObjectReward(entry);
flag = info != null;
break;
case RewardType.SkillPercentage:
info = ParseSkillRewardInfo(entry);
flag = info != null;
break;
case RewardType.RandomFish:
info = RewardsManager.ParseRandomFishRewardInfo(entry);
flag = info != null;
break;
case RewardType.PaintingValueBoost:
info = RewardsManager.ParsePaintingValueBoostRewardInfo(entry);
flag = info != null;
break;
case RewardType.GroupMeal:
info = RewardsManager.ParseGroupMealReward(entry);
flag = info != null;
break;
case RewardType.ObjectInMail:
info = RewardsManager.ParseObjectInMailReward(entry);
flag = info != null;
break;
case RewardType.Harvestable:
info = RewardsManager.ParseHarvestableRewardInfo(entry);
flag = info != null;
break;
//.........这里部分代码省略.........
示例8: ParseRequirements
private static ArrayList ParseRequirements(XmlDbRow dr, OpportunityNames opportunityKey)
{
ArrayList list = new ArrayList();
for (int i = 1; i <= 8; i++)
{
List<string> entry = dr.GetStringList("Requirement" + i, ',', false);
if (entry.Count > 0)
{
RequirementType type;
ParserFunctions.TryParseEnum<RequirementType>(entry[0], out type, RequirementType.Undefined);
Opportunity.OpportunitySharedData.RequirementInfo info = null;
if (type == RequirementType.Undefined)
{
info = new Opportunity.OpportunitySharedData.RequirementInfo();
info.mData = dr.GetString("Requirement" + i);
info.mType = RequirementType.Undefined;
}
else
{
switch (type)
{
case RequirementType.Career:
info = ParseCareerRequirements(entry);
break;
case RequirementType.Skill:
info = ParseSkillRequirements(entry);
break;
case RequirementType.Trait:
info = OpportunityManager.ParseTraitRequirements(entry);
break;
case RequirementType.WorldHasRabbitHoleType:
info = OpportunityManager.ParseWorldHasRabbitHoleRequirement(entry);
break;
case RequirementType.LearnableRecipeExists:
case RequirementType.HasAcquaintanceOrHigher:
case RequirementType.HasYAAcquaintanceOrHigher:
case RequirementType.HasNonFriendCoworker:
case RequirementType.WorldHasPregnantSim:
case RequirementType.HasChildOrTeenAcquaintanceOrHigher:
case RequirementType.IsElder:
case RequirementType.WorldHasCommunityLot:
case RequirementType.HasHighRelationshipWithDeadSim:
case RequirementType.Unemployed:
case RequirementType.HasSingleSim:
info = new Opportunity.OpportunitySharedData.RequirementInfo();
info.mType = type;
break;
case RequirementType.HasObjectOnHomeLot:
case RequirementType.WorldHasLotWith:
info = OpportunityManager.ParseObjectRequirement(entry);
info.mType = type;
break;
case RequirementType.KnowsRecipe:
info = OpportunityManager.ParseKnowsRecipeRequirement(entry);
break;
case RequirementType.HasStrangers:
info = OpportunityManager.ParseHasStrangersRequirement(entry);
break;
case RequirementType.HasNonHouseholdAdultSims:
info = OpportunityManager.ParseHasNonHouseholdAdultSimsRequirement(entry);
break;
case RequirementType.WorldHasInvitableSimInCareer:
case RequirementType.WorldHasSimInCareer:
case RequirementType.WorldHasSkillTutorableSimInCareer:
info = OpportunityManager.ParseWorldHasSimInCareerRequirement(entry);
info.mType = type;
break;
case RequirementType.HasInvitableCoworker:
info = OpportunityManager.ParseHasInvitableCoworkerRequirement(entry);
break;
case RequirementType.HasGrade:
info = OpportunityManager.ParseHasGradeRequirement(entry);
break;
case RequirementType.HasPlanted:
info = OpportunityManager.ParseHasPlantedRequirement(entry);
break;
case RequirementType.HasWrittenXBooksOfGenre:
info = OpportunityManager.ParseHasWrittenXBooksOfGenreRequirement(entry);
break;
case RequirementType.OpportunityNotComplete:
info = ParseOpportunityNotCompleteRequirement(entry);
break;
case RequirementType.OpportunityComplete:
//.........这里部分代码省略.........
示例9: ParseModifiers
private static ArrayList ParseModifiers(XmlDbRow dr, string[] columnKeys, int numRewards)
{
ArrayList list = new ArrayList();
for (int i = 0x0; i < numRewards; i++)
{
bool flag = false;
List<string> stringList = dr.GetStringList(columnKeys[i], ',');
if (stringList.Count > 0x0)
{
ModifierType type;
ParserFunctions.TryParseEnum<ModifierType>(stringList[0x0], out type, ModifierType.Undefined);
ModifierInfo info = null;
switch (type)
{
case ModifierType.Mood:
case ModifierType.RelationshipWithBoss:
case ModifierType.RelationshipWithCoworkers:
info = new ModifierInfo();
info.mType = type;
flag = int.TryParse(stringList[0x1], out info.mAmount);
break;
case ModifierType.Skill:
info = ParseSkillModifierInfo(stringList);
flag = info != null;
break;
}
if (flag)
{
list.Add(info);
}
}
}
if (list.Count != 0x0)
{
return list;
}
return null;
}
示例10: Perform
// From AcademicDegreeManager:CreateAcademicDegreeTable
protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
{
AcademicDegreeNames academicDegree = AcademicDegreeNames.Undefined;
if (!row.TryGetEnum<AcademicDegreeNames>("AcademicDegreeEnum", out academicDegree, AcademicDegreeNames.Undefined))
{
academicDegree = unchecked((AcademicDegreeNames)ResourceUtils.HashString64(row.GetString("AcademicDegreeEnum")));
}
BooterLogger.AddTrace("AcademicDegreeEnum: " + row.GetString("AcademicDegreeEnum"));
string degreeNameKey = row.GetString("AcademicDegreeName");
string degreeDescKey = row.GetString("AcademicDegreeDesc");
string degreeIcon = row.GetString("AcademicDegreeIcon");
int degreeCreditHours = row.GetInt("AcademicDegreeRequiredCreditHours");
float degreeCostPerCredit = row.GetFloat("AcademicDegreeCostPerCredit");
string degreeResponsibilitiesKey = row.GetString("ResponsibilityTooltipKey");
JobId academicDefaultCourseID;
if (!row.TryGetEnum<JobId>("AcademicDefaultCourseID", out academicDefaultCourseID, JobId.AcademicsGenericRabbitHoleCourse))
{
// Custom
academicDefaultCourseID = unchecked((JobId)ResourceUtils.HashString64(row.GetString("AcademicDefaultCourseID")));
}
JobId academicDefaultLectureID;
if (!row.TryGetEnum<JobId>("AcademicDefaultLectureID", out academicDefaultLectureID, JobId.Invalid))
{
// Custom
academicDefaultLectureID = unchecked((JobId)ResourceUtils.HashString64(row.GetString("AcademicDefaultLectureID")));
}
JobId academicDefaultLabID;
if (!row.TryGetEnum<JobId>("AcademicDefaultLabID", out academicDefaultLabID, JobId.Invalid))
{
// Custom
academicDefaultLabID = unchecked((JobId)ResourceUtils.HashString64(row.GetString("AcademicDefaultLabID")));
}
List<OccupationNames> associatedOccupations = new List<OccupationNames>();
List<string> list2 = row.GetStringList("AssociatedOccupationNameEnum", ',', true);
for (int i = 0x0; i < list2.Count; i++)
{
OccupationNames occupation;
if (!ParserFunctions.TryParseEnum<OccupationNames>(list2[i], out occupation, OccupationNames.Undefined))
{
occupation = unchecked((OccupationNames)ResourceUtils.HashString64(row.GetString(list2[i])));
}
if (occupation != OccupationNames.Undefined)
{
associatedOccupations.Add(occupation);
}
}
OccupationNames grantedOccupation;
if (!ParserFunctions.TryParseEnum<OccupationNames>("GrantedOccupationNameEnum", out grantedOccupation, OccupationNames.Undefined))
{
// Custom
grantedOccupation = unchecked((OccupationNames)ResourceUtils.HashString64(row.GetString("GrantedOccupationNameEnum")));
}
List<TraitNames> beneficialTraits;
List<TraitNames> detrimentalTraits;
List<TraitNames> suggestedTraits;
ParserFunctions.TryParseCommaSeparatedList<TraitNames>(row["BeneficialTraits"], out beneficialTraits, TraitNames.Unknown);
ParserFunctions.TryParseCommaSeparatedList<TraitNames>(row["DetrimentalTraits"], out detrimentalTraits, TraitNames.Unknown);
ParserFunctions.TryParseCommaSeparatedList<TraitNames>(row["SuggestedTraits"], out suggestedTraits, TraitNames.Unknown);
AcademicDegreeStaticData staticData = null;
if (!AcademicDegreeManager.sDictionary.TryGetValue((ulong)academicDegree, out staticData))
{
staticData = new AcademicDegreeStaticData(academicDegree, degreeNameKey, degreeDescKey, degreeResponsibilitiesKey, degreeIcon, degreeCreditHours, degreeCostPerCredit, academicDefaultCourseID, academicDefaultLectureID, academicDefaultLabID, associatedOccupations, grantedOccupation, beneficialTraits, detrimentalTraits, suggestedTraits);
}
else
{
staticData.BeneficialTraits.AddRange(beneficialTraits);
staticData.DetrimentalTraits.AddRange(detrimentalTraits);
staticData.SuggestedTraits.AddRange(suggestedTraits);
staticData.AssociatedOccupations.AddRange(associatedOccupations);
}
string skillsThatGrantXP = row.GetString("SkillsThatGrantXP");
if (!string.IsNullOrEmpty(skillsThatGrantXP))
{
foreach (string str6 in skillsThatGrantXP.Split(new char[] { ';' }))
{
string[] strArray2 = str6.Split(new char[] { ',' });
if (strArray2.Length != 0x2) continue;
float num4 = ParserFunctions.ParseFloat(strArray2[0x1], -1234123f);
if (num4 == -1234123f) continue;
// Custom
SkillNames skillName = SkillManager.sSkillEnumValues.ParseEnumValue(strArray2[0x0]);
if (skillName == SkillNames.None) continue;
staticData.AddSkill(skillName, num4);
}
//.........这里部分代码省略.........
示例11: ITUNSettings
public ITUNSettings(string name, XmlDbRow row)
: this(name)
{
mFlags = Flags.None;
if (row.Exists("Autonomous"))
{
mAutonomous = row.GetBool("Autonomous");
mFlags |= Flags.Autonomous;
}
if (row.Exists("UserDirected"))
{
mUserDirected = row.GetBool("UserDirected");
mFlags |= Flags.UserDirected;
}
if (row.Exists("AgeSpecies"))
{
mAgeSpecies = row.GetEnum<CASAGSAvailabilityFlags>("AgeSpecies", CASAGSAvailabilityFlags.None);
if (mAgeSpecies == CASAGSAvailabilityFlags.None)
{
BooterLogger.AddError("Unknown AgeSpecies: " + row.GetString("AgeSpecies"));
}
else
{
mFlags |= Flags.AgeSpecies;
mAgeSpeciesList = null;
}
}
if (row.Exists("Availability"))
{
mAvailability = row.GetEnum<Availability.FlagField>("Availability", Availability.FlagField.None);
if (mAvailability == Availability.FlagField.None)
{
BooterLogger.AddError("Unknown Availability: " + row.GetString("Availability"));
}
else
{
mFlags |= Flags.Availability;
}
}
if (row.Exists("Advertised"))
{
ParseAdvertised(row.GetStringList("Advertised", ','));
}
}