当前位置: 首页>>代码示例>>C#>>正文


C# FieldDefinition.GetType方法代码示例

本文整理汇总了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);
        }
开发者ID:maratbakirov,项目名称:spmeta2,代码行数:8,代码来源:SerializationServicesTests.cs

示例2: CanSerializeAndDeserializeJSON

        public void CanSerializeAndDeserializeJSON()
        {
            var obj = new FieldDefinition();
            var jsonService = new DefaultJSONSerializationService();

            var strValue = jsonService.Serialize(obj);
            jsonService.Deserialize(obj.GetType(), strValue);

        }
开发者ID:karayakar,项目名称:spmeta2,代码行数:9,代码来源:SerializationServicesTests.cs

示例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()));
            }
        }
开发者ID:karayakar,项目名称:spmeta2,代码行数:18,代码来源:ClientFieldDefinitionValidator.cs

示例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()));
        }
开发者ID:Uolifry,项目名称:spmeta2,代码行数:18,代码来源:FieldModelHandler.cs


注:本文中的SPMeta2.Definitions.FieldDefinition.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。