private static string GetProcessHeader(BlueToothCmds bthcmds) { StringBuilder sb = new StringBuilder(); sb.Append("Time" + LOG_DELIMIT); bthcmds.ForEach(x => { if (!string.IsNullOrEmpty(x.Name) && (x.Selection_Type == BlueToothCmds.SELECTION_TYPE.USER || x.Selection_Type == BlueToothCmds.SELECTION_TYPE.USER_PROCESS)) { sb.Append(x.Name + LOG_DELIMIT); } }); return(sb.ToString()); }
private static string GetProcessHeader(BlueToothCmds bthcmds, ICollection <BluetoothCmd> lbthcmds) { StringBuilder sb = new StringBuilder(); sb.Append("Time" + LOG_DELIMIT); lbthcmds.Clear(); bthcmds.ForEach(x => { // If valid append to string and add to working list if (!string.IsNullOrEmpty(x.Name) && (x.Selection_Type == BlueToothCmds.SELECTION_TYPE.USER || x.Selection_Type == BlueToothCmds.SELECTION_TYPE.USER_PROCESS)) { sb.Append(x.Name + LOG_DELIMIT); lbthcmds.Add(x); } }); sb.Append(Environment.NewLine); return(sb.ToString()); }