public String SignalMesasageSearch(String InputSignalName, StreamReader reader) { //Objective: Search Related message to the input Signal //Input : SignalName and OpenFile Stream //OutPut : Returns Message Related to the input Signal string line; String EncodedSignal = null; reader.BaseStream.Seek(0, System.IO.SeekOrigin.Begin); while ((line = reader.ReadLine()) != null) { if (line == "Signal_representation {") { while ((line = reader.ReadLine()) != "}") { string[] Signal = line.Split(':'); string[] SignalSplit = Signal[1].Split(','); foreach (string Sig in SignalSplit) { if (Sig.Trim(new Char[] { ';', ' ' }) == InputSignalName) { EncodedSignal = Signal[0].Trim(); } } } } } return(EncodedSignal + " {");// In Signal Encoding It Searches for Message and { }