コード例 #1
0
 public bool CheckVectors(VectorObject Vobject)
 {
     bool isValid = true ;
     isValid= Vobject.Operation == "Suma";
     isValid = Vobject.Vectors.Count == 2;
     isValid = Vobject.NumberParams > 0;
     return isValid;
 }
コード例 #2
0
 public string ConvertToJson(int[] addition)
 {
     List<Tuple<string, int[]>> vectors= new List<Tuple<string,int[]>>();
     vectors.Add(new Tuple<string,int[]>("vector", addition));
     VectorObject vObject = new VectorObject()
     {
         NumberParams = 1,
         Vectors = vectors
     };
        return JsonConvert.SerializeObject(vObject);
 }
コード例 #3
0
 private string convertToJson(int[] vector1, int[]vector2)
 {
     List<Tuple<string, int[]>> vectors= new List<Tuple<string, int[]>>();
     vectors.Add(new Tuple<string,int[]>("enteros", vector1));
     vectors.Add(new Tuple<string,int[]>("enteros", vector2));
     VectorObject vObject= new VectorObject(){
         NumberParams=2,
         Operation="Suma",
         Vectors= vectors
     };
     return JsonConvert.SerializeObject(vObject);
 }
コード例 #4
0
 public List<int[]> getVectors(VectorObject result)
 {
     return result.Vectors.Select(x => x.Item2).ToList();
 }