當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。