本文整理汇总了C#中FieldDescriptor.SetFieldToComposite方法的典型用法代码示例。如果您正苦于以下问题:C# FieldDescriptor.SetFieldToComposite方法的具体用法?C# FieldDescriptor.SetFieldToComposite怎么用?C# FieldDescriptor.SetFieldToComposite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldDescriptor
的用法示例。
在下文中一共展示了FieldDescriptor.SetFieldToComposite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeserializeComposite
/// <summary>
///
/// </summary>
/// <param name="root"></param>
/// <param name="currentFieldDescriptor"></param>
private void DeserializeComposite(object root, FieldDescriptor currentFieldDescriptor)
{
Object subRoot = GetSubRoot(currentFieldDescriptor, CurrentTag, root);
if (subRoot != null)
currentFieldDescriptor.SetFieldToComposite(root, subRoot);
else
Debug.WriteLine("subRoot is null: " + root + "." + currentFieldDescriptor.Name + ", tag=" + CurrentTag);
}
示例2: DeserializeComposite
/// <summary>
///
/// </summary>
/// <param name="root"></param>
/// <param name="currentFieldDescriptor"></param>
private void DeserializeComposite(object root, FieldDescriptor currentFieldDescriptor)
{
//while (_jsonReader.Value == null && _jsonReader.TokenType != JsonToken.EndObject)
//_jsonReader.Read();
String tagName = (_jsonReader.Value != null) ? _jsonReader.Value.ToString() : null;
ClassDescriptor subRootClassDescriptor = currentFieldDescriptor.ChildClassDescriptor(tagName);
_jsonReader.Read();
if (subRootClassDescriptor != null && _jsonReader.TokenType == JsonToken.StartObject)
{
string simplId;
var subRoot = GetSubRoot(currentFieldDescriptor, tagName, out simplId);
if (subRoot != null)
currentFieldDescriptor.SetFieldToComposite(root, subRoot);
else if (simplId != null)
{
translationContext.RefObjectNeedsIdResolve(root, currentFieldDescriptor, simplId);
}
}
else
{
Debug.WriteLine("ignore tag: " + tagName + ". expected different tag while deserializing composite.");
_jsonReader.Skip();
}
}
示例3: DeserializeComposite
/// <summary>
///
/// </summary>
/// <param name="root"></param>
/// <param name="currentFieldDescriptor"></param>
/// <returns></returns>
private int DeserializeComposite(Object root, FieldDescriptor currentFieldDescriptor)
{
int length = _blockLength;
Object subRoot = GetSubRoot(currentFieldDescriptor, root);
currentFieldDescriptor.SetFieldToComposite(root, subRoot);
return length;
}