public void ToSDData() { Kind = KindOfData.FactorValue; DData.Clear(); SDData.Clear(); if (SData.Count > 0) { // add keys with 0 value foreach (string s in SData) { try { SDData.Add(s, 0); } catch (Exception e) { } } // renumber keys with new values int i = 0; foreach (KeyValuePair <string, int> pair in SDData) { i++; SDData[pair.Key] = i; } // write values to DData foreach (string s in SData) { DData.Add(SDData[s]); } } }
public void ToDData() { Kind = KindOfData.DoubleValue; DData.Clear(); if (SData.Count > 0) { foreach (string s in SData) { double d = 0; bool b = double.TryParse(s, out d); DData.Add(d); } } }
public void FromDoubles(double[] doubles) { DData.Clear(); DData.AddRange(doubles); ToSDataFromDData(); }