public string CreateColumnDataSaveLine(string data_separator) { //we want // col-data;col-id=20_fa;col-title=Fall 2020;col-subtitle=;col-pos=0 Debug.WriteLine("CreateColumnDataSaveLine"); string return_data_line; string data_line_start = "col-data"; return_data_line = data_line_start; foreach (string cur_data_parameter in Parameter_Names) { //should be like this // Parameter_Names = { "Col_ProjectName", "ColID", "ColTitle", "ColSubtitle", "ColPosition" }; // Parameter_Save_Names = { "", "col-id", "col-title", "col-subtitle", "col-pos" }; //this one is skipped if (cur_data_parameter == "Col_ProjectName") { continue; } string cur_data_addition = ""; string cur_data_save_name = Parameter_Save_Names[Parameter_Names.IndexOf(cur_data_parameter)]; string data_val = ""; switch (cur_data_parameter) { case "ColID": data_val = ColID.ToString(); break; case "ColTitle": data_val = ColTitle.ToString(); break; case "ColSubtitle": data_val = ColSubtitle.ToString(); break; case "ColPosition": data_val = ColPosition.ToString(); break; } cur_data_addition = string.Format("{0}={1}", cur_data_save_name, data_val); return_data_line += data_separator + cur_data_addition; } return(return_data_line); }
public void PrintEntryDataValues() { Debug.WriteLine("\nEntryData class paramters:"); foreach (string cur_param_name in Parameter_Names) { bool basic_formatting = false; bool list_formatting = false; string cur_param_val = ""; List <string> cur_param_lst = new List <string>(); switch (cur_param_name) { case "Entry_ProjectName": cur_param_val = Entry_ProjectName.ToString(); basic_formatting = true; break; case "EntryID": cur_param_val = EntryID.ToString(); basic_formatting = true; break; case "Title": cur_param_val = Title.ToString(); basic_formatting = true; break; case "Subtitle": cur_param_val = Subtitle.ToString(); basic_formatting = true; break; case "ColourHex": cur_param_val = ColourHex.ToString(); basic_formatting = true; break; case "PrereqEntryIDs": cur_param_lst = PrereqEntryIDs; list_formatting = true; break; case "CoreqEntryIDs": cur_param_lst = CoreqEntryIDs; list_formatting = true; break; case "SetColID": cur_param_val = SetColID.ToString(); basic_formatting = true; break; case "ActualColID": cur_param_val = ActualColID.ToString(); basic_formatting = true; break; case "RowPosition": cur_param_val = RowPosition.ToString(); basic_formatting = true; break; case "ColPosition": cur_param_val = ColPosition.ToString(); basic_formatting = true; break; case "AvailColIDs": cur_param_lst = AvailColIDs; list_formatting = true; break; case "Is_Selected": cur_param_val = Is_Selected.ToString(); basic_formatting = true; break; } if (basic_formatting) { Debug.WriteLine(string.Format(" {0,-18} = {1}", cur_param_name, cur_param_val)); } if (list_formatting) { Debug.Write(string.Format(" {0,-18} = ", cur_param_name)); foreach (string cur_val in cur_param_lst) { Debug.Write(string.Format("{0} ", cur_val)); } Debug.WriteLine(""); } } Debug.WriteLine(""); }
public void PrintColumnDataValues() { Debug.WriteLine("\nColumnData class paramters:"); List <string> param_names = new List <string> { "Col_ProjectName", "ColID", "ColTitle", "ColSubtitle", "ColPosition" }; foreach (string cur_param_name in param_names) { bool basic_formatting = false; bool list_formatting = false; string cur_param_val = ""; List <int> cur_param_lst = new List <int>(); switch (cur_param_name) { case "Col_ProjectName": cur_param_val = Col_ProjectName.ToString(); basic_formatting = true; break; case "ColID": cur_param_val = ColID.ToString(); basic_formatting = true; break; case "ColTitle": cur_param_val = ColTitle.ToString(); basic_formatting = true; break; case "ColSubtitle": cur_param_val = ColSubtitle.ToString(); basic_formatting = true; break; case "ColPosition": cur_param_val = ColPosition.ToString(); basic_formatting = true; break; } if (basic_formatting) { Debug.WriteLine(string.Format(" {0,-18} = {1}", cur_param_name, cur_param_val)); } if (list_formatting) { Debug.Write(string.Format(" {0,-18} = ", cur_param_name)); foreach (int cur_val in cur_param_lst) { Debug.Write(string.Format("{0} ", cur_val.ToString())); } Debug.WriteLine(""); } } Debug.WriteLine(""); }