本文整理汇总了C#中SPMeta2.Definitions.FieldDefinition.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# FieldDefinition.GetType方法的具体用法?C# FieldDefinition.GetType怎么用?C# FieldDefinition.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPMeta2.Definitions.FieldDefinition
的用法示例。
在下文中一共展示了FieldDefinition.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanSerializeAndDeserializeXML
public void CanSerializeAndDeserializeXML()
{
var obj = new FieldDefinition();
var service = new DefaultXMLSerializationService();
var strValue = service.Serialize(obj);
service.Deserialize(obj.GetType(), strValue);
}
示例2: CanSerializeAndDeserializeJSON
public void CanSerializeAndDeserializeJSON()
{
var obj = new FieldDefinition();
var jsonService = new DefaultJSONSerializationService();
var strValue = jsonService.Serialize(obj);
jsonService.Deserialize(obj.GetType(), strValue);
}
示例3: GetField
// protected Site HostSite { get; set; }
protected Field GetField(object modelHost, FieldDefinition definition)
{
if (modelHost is SiteModelHost)
return FindExistingSiteField(modelHost as SiteModelHost, definition);
if (modelHost is WebModelHost)
return FindExistingWebField(modelHost as WebModelHost, definition);
else if (modelHost is ListModelHost)
return FindExistingListField((modelHost as ListModelHost).HostList, definition);
else
{
throw new SPMeta2NotSupportedException(
string.Format("Validation for artifact of type [{0}] under model host [{1}] is not supported.",
definition.GetType(),
modelHost.GetType()));
}
}
示例4: FindField
protected Field FindField(object modelHost, FieldDefinition definition)
{
if (modelHost is SiteModelHost)
return FindExistingSiteField(modelHost as SiteModelHost, definition);
if (modelHost is WebModelHost)
return FindExistingWebField(modelHost as WebModelHost, definition);
if (modelHost is ListModelHost)
return FindExistingListField((modelHost as ListModelHost).HostList, definition);
TraceService.ErrorFormat((int)LogEventId.ModelProvisionCoreCall, "FindField() does not support modelHost of type: [{0}]. Throwing SPMeta2NotSupportedException", modelHost);
throw new SPMeta2NotSupportedException(
string.Format("Validation for artifact of type [{0}] under model host [{1}] is not supported.",
definition.GetType(),
modelHost.GetType()));
}