示例#1
0
        public bool Compare(IField other)
        {
            if (other.GetType() != this.GetType())
            {
                return(false);
            }
            ObjectField otherObj = (ObjectField)other;

            if (otherObj.Value == null)
            {
                return(true);
            }
            if (otherObj.Value is Type)
            {
                return(this.Value.GetType() == (Type)otherObj.Value);
            }
            return(this.Value.Equals(otherObj.Value));
        }
示例#2
0
 public static Schema MakeSchema(params object[] parameters)
 {
     IField[] fields = new IField[parameters.Length];
     for (int i = 0; i < parameters.Length; i++)
     {
         if (parameters[i] == null)
         {
             fields[i] = new ObjectField(null);
         }
         else if (parameters[i].GetType() == typeof(string))
         {
             fields[i] = new StringField(((string)parameters[i]).ToLower());
         }
         else
         {
             fields[i] = new ObjectField(parameters[i]);
         }
     }
     return(new Schema(fields));
 }