本文整理匯總了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;
}
示例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;
}
示例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()));
}