本文整理汇总了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()));
}