public void ExtractDataAndRaiseEvent(string data) { char[] seperator = { ' ' }; string[] cmd = data.Split(seperator, 10); string command = cmd[0]; switch (command) { case Commands.StreamStart: if (OnStreamStart != null) { OnStreamStart(); } break; case Commands.StreamStop: if (OnStreamStop != null) { OnStreamStop(); } break; case Commands.StreamData: gazeData.extractTrackerData(streamFormat, data); break; case Commands.StreamFormat: streamFormat.Parse(data); break; } }