示例#1
0
 public static object Field(this CoreWorkItem workItem, CoreField fieldRef, Func <object, Field, object> checker)
 {
     if (!workItem.WorkItem.Fields.Contains((int)fieldRef))
     {
         return(null);
     }
     return((checker == null) ? workItem.WorkItem.Fields[fieldRef].Value : checker(workItem.WorkItem.Fields[fieldRef].Value, workItem.WorkItem.Fields[fieldRef]));
 }
示例#2
0
 public static object Field(this CoreWorkItem workItem, string fieldName, Func <object, Field, object> checker)
 {
     if (!workItem.WorkItem.Fields.Contains(fieldName))
     {
         return(null);
     }
     return((checker == null) ? workItem.WorkItem.Fields[fieldName].Value : checker(workItem.WorkItem.Fields[fieldName].Value, workItem.WorkItem.Fields[fieldName]));
 }
示例#3
0
 public static object Field(this CoreWorkItem workItem, CoreField fieldRef)
 {
     if (!workItem.WorkItem.Fields.Contains((int)fieldRef))
     {
         return(null);
     }
     return(workItem.WorkItem.Fields[fieldRef].Value);
 }
示例#4
0
 // WorkItem class
 public static object Field(this CoreWorkItem workItem, string fieldName)
 {
     if (!workItem.WorkItem.Fields.Contains(fieldName))
     {
         return(null);
     }
     return(workItem.WorkItem.Fields[fieldName].Value);
 }
示例#5
0
 public static string FieldAsString(this CoreWorkItem workItem, CoreField fieldRef, Func <object, Field, object> checker)
 {
     return((workItem.Field(fieldRef, checker) ?? string.Empty).ToString());
 }
示例#6
0
 public static string FieldAsString(this CoreWorkItem workItem, CoreField fieldRef)
 {
     return((workItem.Field(fieldRef) ?? string.Empty).ToString());
 }
示例#7
0
 public static string FieldAsString(this CoreWorkItem workItem, string fieldName)
 {
     return((workItem.Field(fieldName) ?? string.Empty).ToString());
 }
示例#8
0
        public static T Field <T>(this CoreWorkItem workItem, CoreField fieldRef)        // where T : class
        {
            object value = Field(workItem, fieldRef);

            return(WorkItemExtender.ValueAs <T>(value));
        }
示例#9
0
        public static T Field <T>(this CoreWorkItem workItem, string fieldName)        // where T : class
        {
            object value = Field(workItem, fieldName);

            return(WorkItemExtender.ValueAs <T>(value));
        }