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


C# ItemType.GetType方法代码示例

本文整理汇总了C#中Modulo.Collect.OVAL.SystemCharacteristics.ItemType.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ItemType.GetType方法的具体用法?C# ItemType.GetType怎么用?C# ItemType.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Modulo.Collect.OVAL.SystemCharacteristics.ItemType的用法示例。


在下文中一共展示了ItemType.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetValueFromProperty

        /// <summary>
        /// Gets the value from property. The property is defined by the item_ref property of ObjectComponentType.
        /// </summary>
        /// <param name="itemtype">The itemtype.</param>
        /// <param name="propertyName">Name of the property.</param>
        /// <returns></returns>
        private IEnumerable<string> GetValueFromProperty(ItemType itemtype, string propertyName)
        {
            var property = this.GetPropertyByName(itemtype, propertyName, itemtype.GetType());

            var values = new List<String>();
            if (property is EntityItemSimpleBaseType)
            {
                var propertyValue = GetPropertyByName(property, "Value", typeof(EntityItemSimpleBaseType));
                if (propertyValue != null)
                    values.Add(propertyValue.ToString());
            }
            else if (property is EntityItemSimpleBaseType[])
            {
                var propertyValues = GetValuesOfArrayProperty(property);
                if (propertyValues != null)
                    values.AddRange(propertyValues);
            }

            return values;
        }
开发者ID:ywcsz,项目名称:modSIC,代码行数:26,代码来源:LocalVariableObjectComponent.cs

示例2: GetValueFromRecordField

        private IEnumerable<string> GetValueFromRecordField(ItemType itemType, string propertyName, string recordFieldname)
        {
            var values = new List<String>();
            var property = this.GetPropertyByName(itemType, propertyName, itemType.GetType());

            if (property is EntityItemRecordType)
            {
                foreach (var recordField in ((EntityItemRecordType)property).field)
                    if (recordField.name.Equals(recordFieldname, StringComparison.InvariantCultureIgnoreCase))
                        values.Add(recordField.Value);
            }
            else if (property is EntityItemRecordType[])
            {
                foreach (var prop in (EntityItemRecordType[])property)
                    foreach (var recordField in prop.field)
                        if (recordField.name.Equals(recordFieldname, StringComparison.InvariantCultureIgnoreCase))
                            values.Add(recordField.Value);
            }

            return values;
        }
开发者ID:ywcsz,项目名称:modSIC,代码行数:21,代码来源:LocalVariableObjectComponent.cs

示例3: GetCompleteFilepath

 private String GetCompleteFilepath(ItemType itemType)
 {
     if (itemType is OVAL.SystemCharacteristics.file_item)
         return ((OVAL.SystemCharacteristics.file_item)itemType).GetFullFilepath();
     if (itemType is OVAL.SystemCharacteristics.Unix.file_item)
         return ((OVAL.SystemCharacteristics.Unix.file_item)itemType).GetFullFilepath();
     else
         throw new ArgumentException(String.Format("The object type '{0}' is not supported.", itemType.GetType().ToString()));
 }
开发者ID:jonaslsl,项目名称:modSIC,代码行数:9,代码来源:FileEntityOperationEvaluator.cs


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