public static bool addStrToList(string str, List <notedString> strlist) { var chars = str.ToArray(); var isDB = false; for (int i = 0; i < chars.Length; i++) { if (chars[i] > 0x80) { isDB = true; break; } } if (isDB) { var toAdd = new notedString(str); if (!strlist.Contains(toAdd)) { strlist.Add(toAdd); } else { //change note } return(true); } else { return(false); } }
static private List <notedString> readStringFilePlain(string fn, string orifn) { var strlist = new List <notedString>(); var strlines = File.ReadAllLines(orifn, utf8); var notelines = File.ReadAllLines(fn, utf8); for (int i = 0; i < strlines.Length; i++) { var toadd = new notedString(strlines[i], notelines[i]); addStrToList(toadd, strlist); } return(strlist); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj.GetType() != typeof(notedString)) { return(false); } notedString c = obj as notedString; return(this.s == c.s); }
public static bool addStrToList(notedString str, List <notedString> strlist) { var chars = str.s.ToArray(); var isDB = false; for (int i = 0; i < chars.Length; i++) { if (chars[i] > 0x80) { isDB = true; break; } } if (isDB) { if (str.n != null && str.n.Contains("]&&")) { str.n = "[" + shiftJis.GetByteCount(str.s) / 2 + "]&&"; } if (!strlist.Contains(str)) { strlist.Add(str); } else { //change note var find = strlist.IndexOf(str); strlist[find].addNote(str.n); } return(true); } else { return(false); } }