Skip to content

Instantly share code, notes, and snippets.

@mariusz
Created January 19, 2009 19:33
Show Gist options
  • Select an option

  • Save mariusz/49122 to your computer and use it in GitHub Desktop.

Select an option

Save mariusz/49122 to your computer and use it in GitHub Desktop.
private Dictionary<Side, double> GetValuesForSecondBoundry()
{
Dictionary<Side, double> dict = new Dictionary<Side, double>();
List<Side> sides = EnumToList<Side>();
for (int i = 0; i < this.SideAreaSecondConditionsList.Items.Count; i++)
{
int id = int.Parse(this.SideAreaSecondConditionsList.Items[i].SubItems[2].Text);
dict.Add(sides[id], getValueAsDouble(this.SideAreaSecondConditionsList.Items[i].SubItems[1].Text));
}
return dict;
}
private void AddSecondConditionFromDict(double[] values, string[] keys)
{
List<Side> sides = EnumToList<Side>();
this.SideAreaSecondConditionsList.Items.Clear();
for(int i = 0; i < values.Length; i++)
{
int id = int.Parse(keys[i]);
this.SideAreaSecondConditionsList.Items.Add(new ListViewItem(new string[] { sides[id].ToString(), values[i].ToString(), keys[i].ToString() }));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment