public PerseusLoadMatrixControl(IList <string> items, string filename) { InitializeComponent(); MultiListSelector1.Init(items, new[] { "Main", "Numerical", "Categorical", "Text", "Multi-numerical" }, new Func <string[], Parameters>[] { s => new Parameters(PerseusUtils.GetNumFilterParams(s)), s => new Parameters(PerseusUtils.GetNumFilterParams(s)), null, null, null }); if (!string.IsNullOrEmpty(filename)) { UpdateFile(filename); } }
internal void UpdateFile(string filename) { TextBox1.Text = filename; bool csv = filename.ToLower().EndsWith(".csv"); char separator = csv ? ',' : '\t'; string[] colNames; Dictionary <string, string[]> annotationRows = new Dictionary <string, string[]>(); try{ colNames = TabSep.GetColumnNames(filename, PerseusUtils.commentPrefix, PerseusUtils.commentPrefixExceptions, annotationRows, separator); } catch (Exception) { MessageBox.Show("Could not open the file '" + filename + "'. It is probably opened by another program."); return; } string[] colTypes = null; if (annotationRows.ContainsKey("Type")) { colTypes = annotationRows["Type"]; annotationRows.Remove("Type"); } string msg = TabSep.CanOpen(filename); if (msg != null) { MessageBox.Show(msg); return; } MultiListSelector1.Init(colNames); if (colTypes != null) { WpfUtils.SelectExact(colNames, colTypes, MultiListSelector1); } else { WpfUtils.SelectHeuristic(colNames, MultiListSelector1); } }
public IList <Parameters[]> GetSubParameterValues() { return(MultiListSelector1.GetSubParameterValues()); }