private void MessageRecived(object sender, DataReceivedEventArgs e)
        {
            if ( e.Data==null)
                return;

            OnMessageRecived(e.Data);
        }
Пример #2
0
        protected override void process_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            Debug.Print("Output");
            Debug.Print(e.Data);
            string line = e.Data;

            if (line == null)
            {
                return;
            }
            IssueOutputEvent(line);
            if (updateRegex.IsMatch(line))
            {
                Match m        = updateRegex.Match(line);
                float duration = float.Parse(m.Groups[1].Value,
                                             NumberFormatInfo.InvariantInfo);
                float position = float.Parse(m.Groups[2].Value,
                                             NumberFormatInfo.InvariantInfo);
                IssueConvertProgressEvent((int)(100 * position / duration));
            }
            else if (finishedRegex.IsMatch(line))
            {
                IssueFinishedEvent();
            }
            else if (errorRegex.IsMatch(line))
            {
                IssueUnknownFormatEvent();
            }
        }
 //ErrorDataReceivedイベントハンドラ
 private void FFmpeg_ErrorDataReceived(object sender,
                                       System.Diagnostics.DataReceivedEventArgs e)
 {
     if (e.Data != null)
     {
         System.Text.RegularExpressions.MatchCollection mc =
             System.Text.RegularExpressions.Regex.Matches(
                 e.Data, @"frame.*?fps");
         foreach (System.Text.RegularExpressions.Match m in mc)
         {
             string datasuuji = m.Value.Replace("frame", "");
             datasuuji = datasuuji.Replace("fps", "");
             datasuuji = datasuuji.Replace(" ", "");
             datasuuji = datasuuji.Replace("=", "");
             long   datasujiII = long.Parse(datasuuji);
             double ara        = (double)datasujiII / (double)allframe;
             ara = Math.Truncate(ara * 100.0) / 100.0;
             Dispatcher.InvokeAsync(() =>
             {
                 lgwinobj.taskbarItemValue = ara;
                 //lgwinobj.AddLog(DateTime.Now, "TEST:" + ara + "END");
             });
         }
     }
     //エラー出力された文字列を表示する
     Dispatcher.InvokeAsync(() =>
     {
         lgwinobj.AddLog(DateTime.Now, e.Data);
     });
 }
Пример #4
0
 public void Process_OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (string.IsNullOrEmpty(e.Data)) {
     return;
       }
       txtConsoleOutput.AppendText(e.Data + "\n");
 }
        private void ErrorDataReceived(object sender, DataReceivedEventArgs e)
        {
            if (e == null || string.IsNullOrEmpty(e.Data))
                return;

            Logger.Log(e.Data);
        }
Пример #6
0
        private void cmdHelper_CommandDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            if (e.Data != null)
            {
                if (e.Data.ToUpper().Contains(DROP_KEYWORD))
                {
                    this._frameDropChecker.FrameDropCount++;
                }

                if (e.Data.Contains("time="))
                {
                    int startIndex = e.Data.IndexOf("time=") + 5;
                    _param = e.Data.Split(new string[] { "=", " " }, StringSplitOptions.RemoveEmptyEntries);

                    OnDataReceived(this,
                                   new FFmpegDataReceiveArgs(
                                       e.Data.Substring(startIndex, 11), _param[3], _param[1]));
                }

                if (e.Data.ToUpper().Contains("ERROR"))
                {
                    OnErrorOccured(this, e);
                }
            }
        }
Пример #7
0
        /// <summary>
        /// Handles the ErrorDataReceived event of the vlc process.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Diagnostics.DataReceivedEventArgs" /> instance containing the event data.</param>
        private void OnVlcErrorDataReceived(object sender, DataReceivedEventArgs e)
        {
            if (e == null)
                return;

            Trace.TraceError(e.Data);
        }
Пример #8
0
 private void cmd_ErrorDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (e.Data != null)
     {
         //MessageBox.Show(e.Data, "错误");
     }
 }
Пример #9
0
        private static void VBusMonitorOnDataReceived(object sender, DataReceivedEventArgs e)
        {
            //Receives this:
            // LPDU: BC 00 01 08 06 F1 00 81 3C :L_Data low from 0.0.1 to 1/0/6 hops: 07 T_DATA_XXX_REQ A_GroupValue_Write (small) 01

            if (!e.Data.Contains("A_GroupValue_Write"))
                return;

            string address = string.Empty;
            string value = string.Empty;

            Regex regex = new Regex(Regex1);
            Match match = regex.Match(e.Data);

            if (match.Success)
                address = match.Groups[1].Value;

            regex = new Regex(Regex2);
            match = regex.Match(e.Data);

            if (match.Success)
                value = match.Groups[1].Value;

            if (string.IsNullOrWhiteSpace(address) || string.IsNullOrWhiteSpace(value))
                return;

            //TODO: check how it works if value received is more than 1 byte

            if (GroupWrite.IsGroupWriteAvailable())
                GroupWrite.Send(address, value);
        }
Пример #10
0
        public static void printData(object sender, DataReceivedEventArgs e)
        {
            // Critical section
            int pId = ((Process)sender).Id;

            if (!colors.ContainsKey(pId))
            {
                lock (lockObject)
                {
                    if (!colors.ContainsKey(pId))
                    {
                        colors.Add(pId, getColor());
                    }
                }
            }

            Console.ForegroundColor = colors[pId];
            if (String.IsNullOrEmpty(e.Data))
            {
                Console.WriteLine("Process " + (int)colors[pId] + " exited.");
            }
            else
            {
                Console.WriteLine((int)colors[pId] + " " + e.Data);
            }
            Console.ResetColor();
        }
Пример #11
0
 public void proc_DataReceived(object sender, DataReceivedEventArgs e)
 {
     if (!String.IsNullOrEmpty(e.Data))
     {
         this.Srv_Output.Invoke(new UpdateOutputCallback(this.updateoutput), new object[] { e.Data });
     }
 }
Пример #12
0
 void adb_OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (this.InvokeRequired)
         this.Invoke(new Action<object, DataReceivedEventArgs>(adb_OutputDataReceived), sender, e);
     else
         textAdb.AppendText(filterData(e.Data));
 }
Пример #13
0
 //Output Event Handler
 private void OutputEventHandler(object sendingProcess, DataReceivedEventArgs outLine)
 {
     if (!string.IsNullOrEmpty(outLine.Data))
     {
         outputString += outLine.Data + "\n";
     }
 }
Пример #14
0
 /// <summary>
 /// ErrorDataReceivedイベントハンドラ
 /// </summary>
 private void P_ErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     if (e.Data != null)
     {
         this.OutputError.Add(e.Data);
     }
 }
Пример #15
0
 private static void ErrorHandler(object sendingProcess, DataReceivedEventArgs outLine)
 {
     if (outLine.Data != null)
     {
         Console.WriteLine("Error:" + outLine.Data);
     }
 }
Пример #16
0
 private void ReadOutputLine(object sender, DataReceivedEventArgs e)
 {
   if (!string.IsNullOrEmpty(e.Data))
   {
     Log.Debug($"{this.LogPrefix} {e.Data}", this);
   }
 }
Пример #17
0
        private void FaacProcess_OutputDataReceived(object sender, DataReceivedEventArgs e)
        {
            if (e.Data != null && e.Data.Length > 0)
            {
                Regex R = new Regex(@"\(\s*(\d+)%\)");
                Match M = R.Match(e.Data);
                if (M.Success)
                {
                    int NewProgress = Convert.ToInt32(M.Groups[1].Value);

                    if (NewProgress != Progress && !_cancelling)
                    {
                        Progress = NewProgress;
                        // raise the progress changed event
                        ExternalProcessProgressChangedEventArgs eArgs = new ExternalProcessProgressChangedEventArgs(
                          Progress, 1, 1, "Encoding", null, null);
                        async.Post(delegate(object ea)
                        { OnTaskProgressChanged((ExternalProcessProgressChangedEventArgs)ea); },
                          eArgs);
                    }
                    //Console.CursorLeft = 0;
                    //Console.Write(e.Data);
                }
                else
                {
                    //Console.WriteLine(e.Data);
                }
            }
        }
Пример #18
0
 private void process_OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (e.Data != null)
     {
         this.logOutputBuffer.AppendLine(e.Data);
     }
 }
Пример #19
0
 private void Error(object sender,DataReceivedEventArgs e)
 {
     if (e.Data == null)
         Process.ErrorDataReceived -= Error;
     else
         Core.Log(this, e.Data);
 }
Пример #20
0
        private void HandleMediaPlayerOutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            if (e.Data != null)
            {
                String value = e.Data.ToString();
                //Log.Write("O >> " + value);

                if (value.Contains("[STREAM]"))
                {
                    tmp = new Dictionary <string, string>();
                    dict.Add(tmp);
                    return;
                }
                if (value.Contains("[/STREAM]"))
                {
                    tmp = null;
                    return;
                }
                if (tmp != null && value.Contains("="))
                {
                    String[] str = value.Split(new String[] { "=" }, StringSplitOptions.None);
                    if (str.Length == 2 && !tmp.ContainsKey(str[0]))
                    {
                        tmp.Add(str[0], str[1]);
                    }
                    return;
                }
            }
        }
 /// <summary>
 /// The output data received.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (e != null && e.Data != null)
     {
         this.Result = e.Data;
     }
 }
 private void ProcessOnErrorDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.Data))
     {
         output.Add(e.Data);
     }
 }
Пример #23
0
 void Process_ErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     if (ErrorDataReceived != null)
     {
         ErrorDataReceived(sender, e);
     }
 }
Пример #24
0
 void Process_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     if (OutputDataReceived != null)
     {
         OutputDataReceived(sender, e);
     }
 }
Пример #25
0
 /// <summary>
 /// All mplayer error output is read through this function.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleMediaPlayerErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     if (e.Data != null)
     {
         System.Console.WriteLine(e.Data.ToString());
     }
 }
Пример #26
0
        private static void OnErrorDataReceived(object sender, DataReceivedEventArgs e)
        {
            if (e == null || String.IsNullOrWhiteSpace(e.Data))
                return;

            IISLogger.Error(e.Data);
        }
 protected override void process_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     // really just for entertainment, since ffmpeg
     // doesn't seem to send anything to stdout.
     Debug.Print("OUTPUT");
     Debug.Print(e.Data);
 }
 private void ProcessOnErrorDataReceived(object sender, DataReceivedEventArgs dataReceivedEventArgs)
 {
     if (!string.IsNullOrEmpty(dataReceivedEventArgs.Data)) // happened often and added unnecessary blank line to output
     {
         logger.WriteLine(LogKind.Default, dataReceivedEventArgs.Data); // warnings also comes as errors so Default log kind is used to avoid red output for things that are just warnings
     }
 }
Пример #29
0
 private void _dataReceivedCallBack(object sender, DataReceivedEventArgs e)
 {
     if (string.IsNullOrEmpty(e.Data) == false)
     {
         dataReceived += e.Data;
     }
 }
Пример #30
0
 private void StderrHandler(object sendingProcess, DataReceivedEventArgs outLine)
 {
     if (!String.IsNullOrEmpty(outLine.Data))
     {
         stderr.Add(outLine.Data);
     }
 }
Пример #31
0
 /// <summary>
 /// All mplayer error output is read through this function.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleMediaPlayerErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     if (e.Data != null)
     {
         MplayerError?.Invoke(sender, e);
     }
 }
Пример #32
0
        //\! =================================================================================================

        //\! ========================================= 服务 ==================================================
        private void outputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            dispatcher.Invoke(() =>
            {
                string _result = e.Data;
            });
        }
        private void CommandLine_OnDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            if (string.IsNullOrEmpty(e.Data))
            {
                return;
            }

            try
            {
                if (!_upgradingInProgresss)
                {
                    cmdresponse.AppendLine(e.Data);
                    return;
                }

                AppendEventLog(e.Data);
                ParseUpgradingResponses(e.Data, out int percent, out string status, out string timespan);
                UpdateProgress(percent, status, timespan);
                if (status == "ERROR")
                {
                    try { _cmdLine.Close(); } catch { }
                    _upgradingInProgresss = false;
                }
            }
            catch (Exception ex)
            {
                PopupException(ex.Message);
            }
        }
Пример #34
0
 private void proc_OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.Data))
     {
         Console.WriteLine(e.Data + Environment.NewLine);
     }
 }
Пример #35
0
 private void EventHandler_OutputDataReceived(object sender, DataReceivedEventArgs ev)
 {
     if (ev.Data != null)
     {
         lines.Add(ev.Data);
     }
 }
Пример #36
0
 void Convert__OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (!String.IsNullOrEmpty(e.Data))
     {
         _sbOutput.AppendLine(e.Data);
     }
 }
Пример #37
0
 private static void ProcessOutputDataHandler(object sendingProcess, DataReceivedEventArgs outLine)
 {
     if (!String.IsNullOrEmpty(outLine.Data))
     {
         getData(outLine.Data);
     }
 }
Пример #38
0
 void p_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     Console.WriteLine("####################DATA RECIVED");
     if (e.Data != null && e.Data != "")
     {
         string line = e.Data.ToString().Trim();
         Console.WriteLine("--> " + line);
         if (line.Contains("mate"))
         {
             MessageBoxResult result = MessageBox.Show("Przegrales");
             process.WaitForExit();
         }
         if (line.StartsWith("bestmove"))
         {
             string[] token = line.Split(new char[] { ' ' });
             if (token.Length > 1)
             {
                 Console.WriteLine(token[1]);
                 char tmp = token[1][0];
                 answer[0] = (int)tmp - 97;
                 answer[1] = 8 - (int)Char.GetNumericValue(token[1][1]);
                 char tmp2 = token[1][2];
                 answer[2] = (int)tmp2 - 97;
                 answer[3] = 8 - (int)Char.GetNumericValue(token[1][3]);
             }
         }
     }
 }
Пример #39
0
 private void AppendErrorData(object sender, DataReceivedEventArgs e)
 {
     if (e.Data == null)
         errorWaitHandle.Set();
     else
         errorOuput.AppendLine(e.Data);
 }
Пример #40
0
 public static void OutputReceivedDataEventHandler(Object Sender, DataReceivedEventArgs Line)
 {
     if ((Line != null) && (Line.Data != null))
     {
         Log.TraceInformation(Line.Data);
     }
 }
 void OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.Data))
     {
         Host.UI.WriteLine(e.Data);
     }
 }
Пример #42
0
 void proc_OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     if(!string.IsNullOrEmpty(e.Data)) {
         _output.AppendLine(e.Data);
         WriteLog(e.Data);
     }
 }
Пример #43
0
 void process_OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     if (e.Data == null) return;
     string data = e.Data;
     if (data.StartsWith("Enter passphrase"))
         ((Process)sender).StandardInput.WriteLine("achttien");
 }
Пример #44
0
 private void BaseServer_OutPutEvent(System.Diagnostics.DataReceivedEventArgs e)
 {
     try
     {
         var log = e.Data;
         if (log != null)
         {
             if (log.Split('[')[1] != null)
             {
                 if (log.Split('[')[1].Split(']')[0] != null)
                 {
                     if (log.Split('[')[1].Split(']')[0].Split(':') != null)
                     {
                         if (log.Split('[')[1].Split(']')[0].Split(':').Length == 3)
                         {
                         }
                         //  OPC.AddToOutput("fff", log.Split(']')[0] + "]", log.Replace(log.Split(']')[0] + "]", ""));
                         else
                         {
                         }
                     }
                 }
             }
         }
         //   OPC.AddToOutput("fff", "", log);
     }
     catch { }
 }
Пример #45
0
 static void ReadProcessErrorEventHandler(object sender, SD.DataReceivedEventArgs e)
 {
     if (e.Data == null)
     {
         return;
     }
     Debug.LogError(e.Data);
 }
Пример #46
0
 private static void HandleMediaPlayerErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     if (e.Data != null)
     {
         value = e.Data.ToString();
         Log.Write("ERROR >> " + value);
     }
 }
Пример #47
0
 private void CommandOutputReceived(object sender, System.Diagnostics.DataReceivedEventArgs e, bool isError)
 {
     if (!String.IsNullOrEmpty(e.Data))
     {
         string tag = isError ? "stderr: " : "stdout: ";
         LogMessage(tag + e.Data, isError);
     }
 }
Пример #48
0
 public void OutputHandler(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     if (e.Data != null)
     {
         Debug.WriteLine(String.Format("output >> {0}", e.Data));
         output += e.Data + "\r\n";
     }
 }
Пример #49
0
        /// <summary>
        /// On Data Received event handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void APIListDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            string         name        = "";
            string         description = "";
            string         version     = "";
            string         error       = "";
            APITargetClass api         = null;

            if (e.Data != null)
            {
                if ((e.Data.ToLower().Contains("error")) || (_error != ""))
                {
                    _error = _error + e.Data;
                }
                else if ((e.Data.Contains("Location:")) || (e.Data.Contains("Available")))
                {
                    // Do Nothing
                }
                else
                {
                    version     = e.Data.Substring(0, e.Data.LastIndexOf(" - "));
                    name        = e.Data.Substring(e.Data.LastIndexOf(" - ") + 3);
                    description = "Device Support Unknown.";

                    api = _tempAPITargetList.Find(i => i.TargetName == name);

                    if (api == null)
                    {
                        api = new APITargetClass(name, description, version);
                        _tempAPITargetList.Add(api);
                    }
                    else
                    {
                        switch (api.IsInstalled)
                        {
                        case 0:
                            api.TargetVersion = version;
                            api.LatestVersion = version;
                            break;

                        case 1:
                            api.IsUpdate      = true;
                            api.LatestVersion = version;
                            break;

                        case 2:
                            api.TargetVersion = version;
                            api.LatestVersion = "NDK";
                            break;
                        }
                    }

                    api.IsInstalled = IsAPIInstalled(api.TargetVersion, api.TargetName);

                    api.IsBeta = name.Contains("Beta");
                }
            }
        }
Пример #50
0
 private static void OutputHandler(object sendingProcess, System.Diagnostics.DataReceivedEventArgs outLine)
 {
     if (outLine.Data == null || outLine.Data.Equals("") || outLine.Data.Contains(PROMPT))
     {
         return;
     }
     // Add the text to the collected output
     initializerOutput.Append(outLine.Data);
 }
Пример #51
0
        void Process_OutputDataReceived(object sender, dia.DataReceivedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(e?.Data))
            {
                return;
            }

            results.Rows.Add("process", Arguments, FileName + Arguments, true, e.Data, sw.ElapsedMilliseconds, e.Data, null, StartedDate);
        }
Пример #52
0
 /// <summary>
 /// 標準出力データを受け取った時の処理
 /// </summary>
 void p_OutputDataReceived(object sender,
                           System.Diagnostics.DataReceivedEventArgs e)
 {
     //processMessage(sender, e);
     if (e != null && e.Data != null && e.Data.Length > 0)
     {
         standardOutputStringBuilder.Append(e.Data + "\n");
     }
 }
Пример #53
0
 //OutputDataReceivedイベントハンドラ
 //行が出力されるたびに呼び出される
 private static void p_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     if (e.Data != null && e.Data.EndsWith("}"))
     {
         var data = e.Data.Replace("\r\r\n", "\n"); // 改行コードの修正
                                                    //出力された文字列を表示する
         _ReadMessage(data);
     }
 }
Пример #54
0
        /// <summary>
        /// On Error received event handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            if (e.Data != null)
            {
                System.Diagnostics.Debug.WriteLine(e.Data);

                MessageBox.Show(e.Data);
            }
        }
Пример #55
0
 private void Error(object sendProcess, System.Diagnostics.DataReceivedEventArgs output)
 {
     if (!String.IsNullOrEmpty(output.Data))
     {
         //处理方法...
         // string message = output.Data;
         //  CommonHelp.WriteLOG("Error" + message);
     }
 }
Пример #56
0
 void ActiveProcess_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     this.Invoke(new MethodInvoker(() => textBoxLog.AppendText(e.Data + System.Environment.NewLine)));
     if (WindowState == FormWindowState.Minimized && !Settings.Default.ShowTrayNotifications)
     {
         this.Invoke(
             new MethodInvoker(() => notifyIcon.ShowBalloonTip(1000, "SyncthingTray", e.Data, ToolTipIcon.Info)));
     }
 }
Пример #57
0
 void output_handler(object obj, System.Diagnostics.DataReceivedEventArgs arg)
 {
     if (arg.Data != null)
     {
         this.Invoke(new Action(() =>
         {
             console_message.AppendText(arg.Data + "\r\n");
         }));
     }
 }
Пример #58
0
 void POLConsole_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     if (txtPOLConsole.Text.Length > 32000)
     {
         txtPOLConsole.Invoke((MethodInvoker) delegate() { txtPOLConsole.Text = "<clearing POL Output Buffer To Avoid Crash>" + System.Environment.NewLine; });
     }
     if (e.Data != String.Empty && e.Data != null)
     {
         txtPOLConsole.Invoke((MethodInvoker) delegate() { txtPOLConsole.Text += e.Data + System.Environment.NewLine; });
     }
 }
 private static void Process_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     try
     {
         Console.WriteLine(e.Data);
         File.AppendAllText("Logs.txt", "Output: " + e.Data + "\n"); // Log standard output to file.
     }
     catch (Exception)
     {
     }
 }
Пример #60
0
 public override void serviceProcess_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
 {
     try
     {
         Console.WriteLine(e.Data.ToString());
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }