コード例 #1
0
        //We pass the variables as parameter to avoid global state. (This facilitates concurrent execution)
        public GenObj GetValue(object fieldName, Dictionary <string, object> variables)
        {
            if (fieldName != null && variables.ContainsKey(fieldName.ToString()))
            {
                return(GenObj.GetGenObj(variables[fieldName.ToString()].ToTrimmedUpperStr()));
            }

            return(GenObj.GetGenObj(null));
        }
コード例 #2
0
        public static GenObj GetGenObj(object val)
        {
            if (val is GenObj)
            {
                return((GenObj)val);
            }
            GenObj obj = new GenObj();

            obj.value = val;
            return(obj);
        }
コード例 #3
0
ファイル: GenObj.cs プロジェクト: amiralles/powergrid
 public static GenObj GetGenObj(object val)
 {
     if (val is GenObj)
         return (GenObj)val;
     GenObj obj = new GenObj();
     obj.value = val;
     return obj;
 }
コード例 #4
0
 public static bool operator !=(double left, GenObj right)
 {
     return(!AreEquals(GenObj.GetGenObj(left).AsDouble(), GenObj.GetGenObj(right).AsDouble()));
 }
コード例 #5
0
 public static bool operator ==(GenObj left, double right)
 {
     return(AreEquals(GenObj.GetGenObj(left).AsDouble(), GenObj.GetGenObj(right).AsDouble()));
 }
コード例 #6
0
 public static bool operator !=(string obj1, GenObj obj2)
 {
     return(!AreEquals(GenObj.GetGenObj(obj1), obj2));
 }
コード例 #7
0
 public static bool operator !=(bool left, GenObj right)
 {
     return(!AreEquals(GenObj.GetGenObj(left), right));
 }
コード例 #8
0
 public static bool operator !=(GenObj left, bool right)
 {
     return(!AreEquals(left, GenObj.GetGenObj(right)));
 }