static private void ParseDrawCmd(string cmd) { //List<Line> lines = new List<Line>(); string[] lines; int beginInfoInd = cmd.IndexOf('-'); int typeInd = cmd.IndexOf(':'); string type = cmd.Substring(beginInfoInd + 1,typeInd - beginInfoInd - 1); if (type.Equals("data")) { string allLines = cmd.Substring(typeInd + 1); lines = allLines.Split('|'); drawDelegate?.Invoke(lines); } }