Ejemplo n.º 1
0
        private void ResultProcessing(String result)
        {
            string       aLine     = null;
            StringReader strReader = new StringReader(result);

            while (true)
            {
                aLine = strReader.ReadLine();
                if (aLine != null)
                {
                    //Logger(aLine);
                    StdOutCmdLine cmdLine = StdOutCmdLine.FromString(aLine);
                    if (cmdLine != null)
                    {
                        ReportProgress(cmdLine.Tag);
                        if (CmdOutputTag.RESULT.Equals(cmdLine.Tag))
                        {
                            StopProgressBarAnimation(false);
                            ReportProgress(cmdLine.Tag);

                            Data_ResultJson result_json = JsonConvert.DeserializeObject <Data_ResultJson>(cmdLine.Data);
                            if (result_json != null)
                            {
                                showResult(result_json);
                            }
                        }
                    }
                }
                else
                {
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        public static StdOutCmdLine FromString(string line)
        {
            //CheckLog.Logger(line);
            //if (line.Length > FIX_LENGTH) CheckLog.Logger("length more than 4");
            //if (line.Substring(0, FIX_LENGTH).Equals(PREFIX)) CheckLog.Logger("is [>>]");
            if (line.Length > FIX_LENGTH && line.Substring(0, FIX_LENGTH).Equals(PREFIX))
            {
                string jsonData = line.Substring(FIX_LENGTH);


                StdOutCmdLine data = JsonConvert.DeserializeObject <StdOutCmdLine>(jsonData);



                return(data);
            }
            return(null);
        }