Sort the make and model in the printer selection menus.

This commit is contained in:
Lars Brubaker 2016-07-12 09:40:57 -07:00
parent f79b32a11e
commit f16aed3669
2 changed files with 21 additions and 2 deletions

View file

@ -187,7 +187,16 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
printers = new Dictionary<string, string>();
}
printerModelSelector.ListSource = printers.Select(profile => new KeyValuePair<string, string>(profile.Key, profile.Value)).ToList();
var models = printers.Select(profile => new KeyValuePair<string, string>(profile.Key, profile.Value)).ToList();
// sort by key (model name)
models.Sort(
delegate (KeyValuePair<string, string> pair1,
KeyValuePair<string, string> pair2)
{
return pair1.Key.CompareTo(pair2.Key);
}
);
printerModelSelector.ListSource = models;
contentRow.Invalidate();