public static object GetPropertyValue(CmisProperty property) { if (property is CmisPropertyBoolean) { var boolProperty = ((CmisPropertyBoolean)property); return(boolProperty.SingleValue.HasValue ? default(bool) : boolProperty.SingleValue.Value); } if (property is CmisPropertyDateTime) { var dateTimeProperty = ((CmisPropertyDateTime)property); return(dateTimeProperty.SingleValue); } if (property is CmisPropertyDecimal) { var decimalProperty = ((CmisPropertyDecimal)property); return(decimalProperty.SingleValue.HasValue ? default(decimal) : decimalProperty.SingleValue.Value); } if (property is CmisPropertyHtml) { var htmlProperty = ((CmisPropertyHtml)property); return(htmlProperty.SingleValue); } if (property is CmisPropertyInteger) { var intProperty = ((CmisPropertyInteger)property); return(intProperty.SingleValue.HasValue ? default(int) : intProperty.SingleValue.Value); } return(property.Value); }
public static CmisProperty CreateProperty(string propertyName, object o) { CmisProperty cmisProperty = GetCmisProperty(o); cmisProperty.DisplayName = propertyName; cmisProperty.LocalName = propertyName; cmisProperty.QueryName = propertyName; cmisProperty.PropertyDefinitionId = propertyName; return(cmisProperty); }
public static object GetPropertyValue(CmisProperty property) { if (property is CmisPropertyBoolean) { var boolProperty = ((CmisPropertyBoolean)property); return boolProperty.SingleValue.HasValue ? default(bool) : boolProperty.SingleValue.Value; } if (property is CmisPropertyDateTime) { var dateTimeProperty = ((CmisPropertyDateTime)property); return dateTimeProperty.SingleValue; } if (property is CmisPropertyDecimal) { var decimalProperty = ((CmisPropertyDecimal)property); return decimalProperty.SingleValue.HasValue ? default(decimal) : decimalProperty.SingleValue.Value; } if (property is CmisPropertyHtml) { var htmlProperty = ((CmisPropertyHtml)property); return htmlProperty.SingleValue; } if (property is CmisPropertyInteger) { var intProperty = ((CmisPropertyInteger)property); return intProperty.SingleValue.HasValue ? default(int) : intProperty.SingleValue.Value; } return property.Value; }