本文整理汇总了C#中XmlDbRow.GetEnum方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDbRow.GetEnum方法的具体用法?C# XmlDbRow.GetEnum怎么用?C# XmlDbRow.GetEnum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlDbRow
的用法示例。
在下文中一共展示了XmlDbRow.GetEnum方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSeason
protected WeatherSettings GetSeason(XmlDbRow row)
{
Season season = row.GetEnum<Season>("Season", Season.Spring | Season.Summer | Season.Fall | Season.Winter);
if (season == (Season.Spring | Season.Summer | Season.Fall | Season.Winter))
{
BooterLogger.AddError("Unknown Season: " + row.GetString("Season"));
return null;
}
return Tempest.Settings.GetWeather(season, false);
}
示例2: Parse
public override bool Parse(XmlDbRow row, ref string error)
{
mOccult = row.GetEnum<OccultTypes>("Occult", OccultTypes.None);
if (mOccult == OccultTypes.None)
{
error = "Occult Fail: " + row.GetString("Occult");
return false;
}
mAllowHybrid = row.GetBool("AllowHybrid");
return base.Parse(row, ref error);
}
示例3: 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", ','));
}
}
示例4: ActionDataSetting
public ActionDataSetting(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("AllowPregnant"))
{
mAllowPregnant = row.GetBool("AllowPregnant");
mFlags |= Flags.AllowPregnant;
}
if (row.Exists("ActorAgeSpecies"))
{
mActorAgeSpecies = row.GetEnum<CASAGSAvailabilityFlags>("ActorAgeSpecies", CASAGSAvailabilityFlags.All);
if (mActorAgeSpecies == CASAGSAvailabilityFlags.All)
{
BooterLogger.AddError("Unknown ActorAgeSpecies: " + row.GetString("ActorAgeSpecies"));
}
else
{
mFlags |= Flags.ActorAgeSpecies;
mActorAgeSpeciesList = null;
}
}
if (row.Exists("TargetAgeSpecies"))
{
mTargetAgeSpecies = row.GetEnum<CASAGSAvailabilityFlags>("TargetAgeSpecies", CASAGSAvailabilityFlags.All);
if (mTargetAgeSpecies == CASAGSAvailabilityFlags.All)
{
BooterLogger.AddError("Unknown TargetAgeSpecies: " + row.GetString("TargetAgeSpecies"));
}
else
{
mFlags |= Flags.TargetAgeSpecies;
mTargetAgeSpeciesList = null;
}
}
}
示例5: Parse
public override bool Parse(XmlDbRow row, ref string error)
{
mName = new WeightOption.NameOption(row);
mChanceOfHomeLot = row.GetInt("ChanceOfHome", mChanceOfHomeLot);
mPartyAttire = row.GetEnum<OutfitCategories>("Attire", OutfitCategories.None);
if (mPartyAttire == OutfitCategories.None)
{
error = "Unknown Attire: " + row.GetString("Attire");
return false;
}
mSuccess = new WeightScenarioHelper(Origin.FromSocialization);
if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
{
return false;
}
return base.Parse(row, ref error);
}
示例6: Load
public void Load(XmlDbRow row)
{
sCustomNames = true;
CASAGSAvailabilityFlags specieFlags = ParserFunctions.ParseAllowableAgeSpecies(row, "Species");
string totalName = row.GetString("Name");
if (string.IsNullOrEmpty(totalName)) return;
//BooterLogger.AddError("Names Found: " + totalName);
string[] names = totalName.Split(',');
bool exclusion = row.GetBool("Exclude");
bool isMale = false;
bool isFemale = false;
{
CASAgeGenderFlags gender = row.GetEnum<CASAgeGenderFlags>("Gender", CASAgeGenderFlags.Male | CASAgeGenderFlags.Female);
if ((gender & CASAgeGenderFlags.Male) == CASAgeGenderFlags.Male)
{
isMale = true;
}
if ((gender & CASAgeGenderFlags.Female) == CASAgeGenderFlags.Female)
{
isFemale = true;
}
}
List<CASAgeGenderFlags> species = new List<CASAgeGenderFlags>();
if ((specieFlags & CASAGSAvailabilityFlags.AllCatsMask) != CASAGSAvailabilityFlags.None)
{
species.Add(CASAgeGenderFlags.Cat);
}
if ((specieFlags & CASAGSAvailabilityFlags.AllDogsMask) != CASAGSAvailabilityFlags.None)
{
species.Add(CASAgeGenderFlags.Dog);
}
if ((specieFlags & CASAGSAvailabilityFlags.AllLittleDogsMask) != CASAGSAvailabilityFlags.None)
{
species.Add(CASAgeGenderFlags.LittleDog);
}
if ((specieFlags & CASAGSAvailabilityFlags.AllHorsesMask) != CASAGSAvailabilityFlags.None)
{
species.Add(CASAgeGenderFlags.Horse);
}
if ((specieFlags & CASAGSAvailabilityFlags.HumanAgeMask) != CASAGSAvailabilityFlags.None)
{
species.Add(CASAgeGenderFlags.Human);
}
foreach (CASAgeGenderFlags specie in species)
{
Genders genderList;
if (!mLoadedNames.TryGetValue(specie, out genderList))
{
genderList = new Genders();
mLoadedNames.Add(specie, genderList);
}
for (int i = 0; i < names.Length; i++)
{
string name = names[i].Trim();
if (isMale)
{
if (exclusion)
{
genderList.GetExclusions(false).Add(name, true);
}
else
{
genderList.GetNames(false).Add(name);
}
}
if (isFemale)
{
if (exclusion)
{
genderList.GetExclusions(true).Add(name, true);
}
else
{
genderList.GetNames(true).Add(name);
}
}
}
}
}