本文整理汇总了C#中JsonObject.GetStringField方法的典型用法代码示例。如果您正苦于以下问题:C# JsonObject.GetStringField方法的具体用法?C# JsonObject.GetStringField怎么用?C# JsonObject.GetStringField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonObject
的用法示例。
在下文中一共展示了JsonObject.GetStringField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromJsonObject
/// <summary>
/// Constructs a ModuleDescriptor from a Json object
/// </summary>
/// <param name="InObject"></param>
/// <returns>The new module descriptor</returns>
public static ModuleDescriptor FromJsonObject(JsonObject InObject)
{
ModuleDescriptor Module = new ModuleDescriptor(InObject.GetStringField("Name"), InObject.GetEnumField<ModuleHostType>("Type"));
ModuleLoadingPhase LoadingPhase;
if (InObject.TryGetEnumField<ModuleLoadingPhase>("LoadingPhase", out LoadingPhase))
{
Module.LoadingPhase = LoadingPhase;
}
UnrealTargetPlatform[] WhitelistPlatforms;
if (InObject.TryGetEnumArrayField<UnrealTargetPlatform>("WhitelistPlatforms", out WhitelistPlatforms))
{
Module.WhitelistPlatforms = WhitelistPlatforms;
}
UnrealTargetPlatform[] BlacklistPlatforms;
if (InObject.TryGetEnumArrayField<UnrealTargetPlatform>("BlacklistPlatforms", out BlacklistPlatforms))
{
Module.BlacklistPlatforms = BlacklistPlatforms;
}
string[] AdditionalDependencies;
if (InObject.TryGetStringArrayField("AdditionalDependencies", out AdditionalDependencies))
{
Module.AdditionalDependencies = AdditionalDependencies;
}
return Module;
}
示例2: FromJsonObject
/// <summary>
/// Construct a PluginReferenceDescriptor from a Json object
/// </summary>
/// <param name="RawObject">The Json object containing a plugin reference descriptor</param>
/// <returns>New PluginReferenceDescriptor object</returns>
public static PluginReferenceDescriptor FromJsonObject(JsonObject RawObject)
{
PluginReferenceDescriptor Descriptor = new PluginReferenceDescriptor(RawObject.GetStringField("Name"), null, RawObject.GetBoolField("Enabled"));
RawObject.TryGetStringField("Description", out Descriptor.Description);
RawObject.TryGetStringField("MarketplaceURL", out Descriptor.MarketplaceURL);
RawObject.TryGetEnumArrayField<UnrealTargetPlatform>("WhitelistPlatforms", out Descriptor.WhitelistPlatforms);
RawObject.TryGetEnumArrayField<UnrealTargetPlatform>("BlacklistPlatforms", out Descriptor.BlacklistPlatforms);
return Descriptor;
}
示例3: FromJsonObject
/// <summary>
/// Constructs a LocalizationTargetDescriptor from a Json object
/// </summary>
/// <param name="InObject"></param>
/// <returns>The new localization target descriptor</returns>
public static LocalizationTargetDescriptor FromJsonObject(JsonObject InObject)
{
return new LocalizationTargetDescriptor(InObject.GetStringField("Name"), InObject.GetEnumField<LocalizationTargetDescriptorLoadingPolicy>("LoadingPolicy"));
}