21
Answers

Double [] test

David Smith

David Smith

12y
1.1k
1
I am struggling, I am trying to pass in double [] array and added to my ArrayDictionary , can someone assist me.

 enum ArrayType
{
  Array1,
  Array2,
  Array3

}


  public Dictionary<string, List<double []>> ArrayDictionary { get; set; }

  public void ConstructArray(double[] array1, double[] array2, double[] array3)
  {
  foreach (ArrayType arrayItem in Enum.GetValues(typeof(ArrayType)))
  {
  ArrayDictionary.Add(arrayItem .ToString(), new List<double[]>());

  switch (opticalArrayItem)
  {
  case ArrayType.Array1:

  foreach (double arrayItem in array1)
  {
  // Add to ArrayDictionary
 
  }
  break;

  case ArrayType.Array2:
    foreach (double arrayItem in array1)
  {
  // Add to ArrayDictionary b
 
  }
  break;

  case ArrayType.Array3:
    foreach (double arrayItem in array1)
  {
  // Add to ArrayDictionary
 
  }

  break;
  }
  }
  }

Answers (21)