private ObjectTypes?ObjectTypeOf(IXenObject o) { PropertyAccessor pa = PropertyAccessors.Get(PropertyNames.type); Object obj = pa(o); return((ObjectTypes?)obj); }
public override GridItemBase GetGridItem(IXenObject o) { if (o is Folder) { return(NewStringItem(String.Empty)); // CA-28300.5 } GridItemBase item; if (CheckVMTools(o, out item)) { return(item); } if (PropertyAccessors.Get(property)(o) == null) { return(NewStringItem(new PropertyWrapper(textProperty, o))); } return(NewBarItem( new PropertyWrapper(textProperty, o), new ImageDelegate(delegate() { int?i = (int?)PropertyAccessors.Get(rankProperty)(o); if (i == null) { return null; } return HelpersGUI.GetProgressImage(i.Value); }))); }
public PropertyGrouping(XmlNode node) : base(node) { this.property = (PropertyNames)Enum.Parse(typeof(PropertyNames), Helpers.GetXmlAttribute(node, "property")); this.propertyAccessor = PropertyAccessors.Get(property); this.i18n = PropertyAccessors.PropertyNames_i18n[property]; this.i18ns = Invert((Dictionary <String, T>)PropertyAccessors.Geti18nFor(property)); this.images = (ImageDelegate <T>)PropertyAccessors.GetImagesFor(property); }
public PropertyGrouping(PropertyNames property, Grouping subgrouping) : base(subgrouping) { this.property = property; this.propertyAccessor = PropertyAccessors.Get(property); this.i18n = PropertyAccessors.PropertyNames_i18n[property]; this.i18ns = Invert((Dictionary <String, T>)PropertyAccessors.Geti18nFor(property)); this.images = (ImageDelegate <T>)PropertyAccessors.GetImagesFor(property); }
private PropertyAccessor CalcProperty() { if (column.StartsWith(CustomFieldsManager.CUSTOM_FIELD)) { string fieldName = column.Substring(CustomFieldsManager.CUSTOM_FIELD.Length); CustomFieldDefinition customFieldDefinition = CustomFieldsManager.GetCustomFieldDefinition(fieldName); if (customFieldDefinition == null) // a custom field that existed at the time the search was created but no longer exists { return(o => null); } if (customFieldDefinition.Type == CustomFieldDefinition.Types.Date) { return(delegate(IXenObject o) { object val = CustomFieldsManager.GetCustomFieldValue(o, customFieldDefinition); return (DateTime?)(val is DateTime ? val : null); }); } else { return(delegate(IXenObject o) { object val = CustomFieldsManager.GetCustomFieldValue(o, customFieldDefinition); return val == null ? null : val.ToString(); }); } } ColumnNames c; try { c = (ColumnNames)Enum.Parse(typeof(ColumnNames), column); } catch (ArgumentException) { return(null); } PropertyNames propertyName = PropertyAccessors.GetSortPropertyName(c); return(PropertyAccessors.Get(propertyName)); }
protected PropertyQuery(XmlNode node, bool nullProtect) { this.property = (PropertyNames)Enum.Parse(typeof(PropertyNames), Helpers.GetXmlAttribute(node, "property")); this.propertyAccessor = PropertyAccessors.Get(property); this.nullProtect = nullProtect; }
protected PropertyQuery(PropertyNames property, bool nullProtect) { this.property = property; this.propertyAccessor = PropertyAccessors.Get(property); this.nullProtect = nullProtect; }
public PropertyWrapper(PropertyNames property, IXenObject o) { this.property = PropertyAccessors.Get(property); this.o = o; }