本文整理汇总了C#中XmlDbRow.GetClassType方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDbRow.GetClassType方法的具体用法?C# XmlDbRow.GetClassType怎么用?C# XmlDbRow.GetClassType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlDbRow
的用法示例。
在下文中一共展示了XmlDbRow.GetClassType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Perform
protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
{
string toneName = row.GetString("ToneName");
if (string.IsNullOrEmpty(toneName))
{
BooterLogger.AddError("Tone found with no name");
return;
}
Type classType = row.GetClassType("FullClassName");
if (classType == null)
{
BooterLogger.AddError("Tone: " + toneName + " FullClassName no match");
return;
}
string guid = row.GetString("CareerGuid");
OccupationNames careerGuid = OccupationNames.Undefined;
ParserFunctions.TryParseEnum<OccupationNames>(guid, out careerGuid, OccupationNames.Undefined);
if (careerGuid == OccupationNames.Undefined)
{
careerGuid = unchecked((OccupationNames)ResourceUtils.HashString64(guid));
}
Career staticCareer = CareerManager.GetStaticCareer (careerGuid);
if (staticCareer == null)
{
BooterLogger.AddError("Tone: " + toneName + " CareerGuid no match");
return;
}
staticCareer.SharedData.ToneDefinitions.Add(new CareerBooterToneDefinition(row, classType));
}
示例2: Perform
protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
{
BooterHelper.DataBootFile dataFile = file as BooterHelper.DataBootFile;
if (dataFile == null) return;
mIndex++;
string personalityName = row.GetString("Name");
if (string.IsNullOrEmpty(personalityName))
{
BooterLogger.AddError(file + " : Method " + mIndex + " Unnamed");
return;
}
BooterLogger.AddTrace("Found " + personalityName);
if (GetPersonality(personalityName) != null)
{
BooterLogger.AddError(personalityName + " Name already in use");
return;
}
Type classType = row.GetClassType("FullClassName");
if (classType == null)
{
BooterLogger.AddError(personalityName + " No Class");
return;
}
SimPersonality personality = null;
try
{
personality = classType.GetConstructor(new Type[0]).Invoke(new object[0]) as SimPersonality;
}
catch
{ }
if (personality == null)
{
BooterLogger.AddError(personalityName + ": Constructor Fail " + row.GetString("FullClassName"));
}
else
{
XmlDbTable optionTable = dataFile.GetTable(personalityName);
if (personality.Parse(row, optionTable))
{
sLookup.Add(personalityName.ToLower(), personality);
}
else
{
BooterLogger.AddError(personalityName + ": Parsing Fail");
}
}
}
示例3: Perform
protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
{
Type type = row.GetClassType("Type");
if (type == null)
{
BooterLogger.AddError("Invalid Type: " + row.GetString("Type"));
return;
}
sData.Add(type, true);
BooterLogger.AddTrace(" Discount Type: " + row.GetString("Type"));
}
示例4: Perform
protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
{
string guid = row.GetString("GUID");
if (string.IsNullOrEmpty(guid))
{
BooterLogger.AddError("Invalid GUID: " + guid);
return;
}
else if (sInstigators.ContainsKey(guid))
{
BooterLogger.AddError("Duplicate GUID: " + guid);
return;
}
Type type = row.GetClassType("FullClassName");
if (type == null)
{
BooterLogger.AddError(guid + " Invalid FullClassName: " + row.GetString("FullClassName"));
return;
}
Data symptom = null;
try
{
symptom = type.GetConstructor(new Type[] { typeof(XmlDbRow) }).Invoke(new object[] { row }) as Data;
}
catch (Exception e)
{
BooterLogger.AddError("Contructor Fail: " + row.GetString("FullClassName"));
Common.Exception(guid + Common.NewLine + row.GetString("FullClassName") + " Fail", e);
}
if (symptom != null)
{
sInstigators.Add(guid, symptom);
}
}
示例5: LoadCareer
public void LoadCareer(BooterHelper.BootFile file, XmlDbRow row)
{
BooterHelper.DataBootFile dataFile = file as BooterHelper.DataBootFile;
if (dataFile == null) return;
string careerName = row.GetString("CareerName");
if (careerName == null)
{
BooterLogger.AddError(file.ToString() + ": No CareerName");
}
else
{
Type classType = row.GetClassType("FullClassName");
if (classType != null)
{
string key = row.GetString("TableName");
XmlDbTable levelTable = dataFile.GetTable(key);
if (levelTable != null)
{
foreach (XmlDbRow levelRow in levelTable.Rows)
{
XmlDbData.XmlDbRowFast level = levelRow as XmlDbData.XmlDbRowFast;
if (level == null) continue;
if (!level.Exists("DowntownWakeupTime"))
{
level.mData.Add("DowntownWakeupTime", level.GetString("WakeupTime"));
}
if (!level.Exists("DowntownStartTime"))
{
level.mData.Add("DowntownStartTime", level.GetString("StartTime"));
}
if (!level.Exists("DowntownDayLength"))
{
level.mData.Add("DowntownDayLength", level.GetString("DayLength"));
}
}
Type[] types = new Type[] { typeof(XmlDbRow), typeof(XmlDbTable), typeof(XmlDbTable) };
Career career = null;
try
{
career = classType.GetConstructor(types).Invoke(new object[] { row, levelTable, null }) as Career;
}
catch (Exception e)
{
BooterLogger.AddError(careerName + ": Constructor Fail " + row.GetString("FullClassName"));
Common.Exception(careerName + ": Constructor Fail " + row.GetString("FullClassName"), e);
return;
}
if (career != null)
{
if (mCareerEventsFile.IsValid)
{
XmlDbTable table3 = mCareerEventsFile.GetTable(key);
if (table3 != null)
{
LoadCareerEvents(career, mCareerEventsFile, table3);
}
}
career.mCareerGuid = unchecked((OccupationNames)ResourceUtils.HashString64(row.GetString("AltGuid")));
if (career.Guid == OccupationNames.Undefined)
{
BooterLogger.AddError(careerName + ": No AltGuid");
}
else if (CareerManager.GetStaticCareer(career.mCareerGuid) != null)
{
BooterLogger.AddError(careerName + ": Duplicate GUID");
}
else
{
RabbitHoleType type = RabbitHoleType.None;
ParserFunctions.TryParseEnum<RabbitHoleType>(row.GetString("RabbitholeType"), out type, RabbitHoleType.None);
if (type != RabbitHoleType.None)
{
sCareers.Add(new CareerBooterElement(career.Guid, type));
CareerManager.AddStaticOccupation(career);
BooterLogger.AddTrace(careerName + ": Added to Rabbithole " + type);
}
else
{
BooterLogger.AddError(careerName + ": Unknown Rabbithole");
}
}
}
else
{
BooterLogger.AddError(careerName + ": Constructor Fail " + row.GetString("FullClassName"));
}
}
//.........这里部分代码省略.........
示例6: ParseRewards
//.........这里部分代码省略.........
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;
case RewardType.OmniPlantSeeds:
info = RewardsManager.ParseOmniPlantSeedsRewardInfo(entry);
flag = info != null;
break;
case RewardType.AncientCoin:
info = RewardsManager.ParseAncientCoinInfo(entry);
flag = info != null;
break;
case RewardType.VisaPoints:
info = RewardsManager.ParseVisaPointsInfo(entry);
flag = info != null;
break;
case RewardType.TreasureComponentRow:
info = RewardsManager.ParseTreasureComponentRow(entry);
flag = info != null;
break;
default:
info = new RewardInfo();
info.mType = type;
if (entry.Count == 0x2)
{
flag = int.TryParse(entry[0x1], out info.mAmount);
}
break;
}
if (flag)
{
list.Add(info);
}
}
else
{
Type rewardType = dr.GetClassType(columnKeys[i]);
if (rewardType != null)
{
RewardInfoEx reward = (RewardInfoEx)rewardType.GetConstructor(new Type[0]).Invoke(new object[0]);
if (reward != null)
{
list.Add(reward);
}
else
{
BooterLogger.AddError("Unknown reward: " + dr.GetString(columnKeys[i]));
}
}
else
{
BooterLogger.AddError("Unknown reward: " + dr.GetString(columnKeys[i]));
}
}
}
}
if (list.Count != 0)
{
return list;
}
}
catch (Exception e)
{
Common.Exception("ParseRewards", e);
}
return null;
}
示例7: Parse
public virtual bool Parse(XmlDbRow row)
{
mParentType = row.GetClassType("FullClassName");
if (mParentType == null)
{
BooterLogger.AddError("Unknown FullClassName: " + row.GetString("FullClassName"));
return false;
}
mFieldName = row.GetString("FieldName");
if (string.IsNullOrEmpty(mFieldName))
{
BooterLogger.AddError("FieldName missing for " + mParentType.ToString());
return false;
}
return true;
}
示例8: Perform
protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
{
BooterHelper.DataBootFile dataFile = file as BooterHelper.DataBootFile;
if (dataFile == null) return;
bool success = false;
mIndex++;
try
{
string methodName = row.GetString("Name");
if (string.IsNullOrEmpty(methodName))
{
BooterLogger.AddError(file + " : Method " + mIndex + " Unnamed");
}
else if (ScoringLookup.GetScoring(methodName, false) != null)
{
BooterLogger.AddError(methodName + " Name already in use");
return;
}
else
{
Type classType = row.GetClassType("FullClassName");
if (classType == null)
{
BooterLogger.AddError(methodName + " Unknown FullClassName: " + row.GetString("FullClassName"));
}
else
{
IListedScoringMethod scoring = null;
try
{
scoring = classType.GetConstructor(new Type[0]).Invoke(new object[0]) as IListedScoringMethod;
}
catch
{ }
if (scoring == null)
{
BooterLogger.AddError(methodName + ": Constructor Fail " + row.GetString("FullClassName"));
}
else
{
XmlDbTable scoringTable = dataFile.GetTable(methodName);
if (scoringTable == null)
{
BooterLogger.AddError(methodName + ": Table Missing");
}
else
{
if (scoring.Parse(row, scoringTable))
{
BooterLogger.AddTrace("Added Scoring : " + methodName);
ScoringLookup.AddScoring(methodName, scoring);
success = true;
}
else
{
BooterLogger.AddError(methodName + ": Parsing Fail");
}
}
}
}
}
}
finally
{
if (!success)
{
foreach (string column in row.ColumnNames)
{
BooterLogger.AddError(column + "= " + row[column]);
}
}
}
}
示例9: Parse
public override bool Parse(XmlDbRow row, SimPersonality personality, ref string error)
{
ProductVersion productVersion;
if (!ParserFunctions.TryParseEnum<ProductVersion>(row.GetString("ProductVersion"), out productVersion, ProductVersion.BaseGame))
{
error = "ProductVersion missing";
return false;
}
if (!GameUtils.IsInstalled(productVersion))
{
return true;
}
string module = row.GetString("Module");
if ((!string.IsNullOrEmpty(module)) && (!Common.AssemblyCheck.IsInstalled(module)))
{
return true;
}
// Must be after the product version checks, but before everything else
if (!base.Parse(row, personality, ref error)) return false;
if (!row.Exists("Scenario"))
{
error = "Scenario missing";
return false;
}
else if (!row.Exists("Weight"))
{
error = "Weight missing";
return false;
}
else if (!row.Exists("Name"))
{
error = "Name missing";
return false;
}
mName = new NameOption(row);
Type classType = row.GetClassType("Scenario");
if (classType == null)
{
error = "Scenario class not found";
return false;
}
int weight = row.GetInt("Weight");
if (weight > 0)
{
mVisible = true;
}
else
{
weight = 1;
if (!row.Exists("ShouldPush"))
{
error = "ShouldPush missing";
return false;
}
}
SetValue (weight);
try
{
mScenario = classType.GetConstructor(new Type[0]).Invoke(new object[0]) as Scenario;
}
catch
{}
if (mScenario == null)
{
error = "Scenario constructor fail";
return false;
}
mScenario.Manager = personality;
if (!mScenario.Parse(row, ref error))
{
return false;
}
if (!mScenario.PostParse(ref error))
{
return false;
}
IViolentScenario violentScenario = mScenario as IViolentScenario;
if ((violentScenario != null) && (violentScenario.IsViolent))
{
PushDeathChanceOption.Installed = true;
}
return true;
}