Example #1
0
 void listener_onUpdate(object sender, ProcessStatistics.process_statistics data)
 {
     updateStatus(data);
 }
 void recvr_onUpdate(object sender, ProcessStatistics.process_statistics data)
 {
     //string s = data.processID.ToString() + ", " +
     //        data.sName + ", " +
     //        data.procUsage.user.ToString() + ", " +
     //        data.duration.ToString();
     ////addLog(s);
     
     //System.Diagnostics.Debug.WriteLine( data.dumpStatistics() );
     addData(data);
 }
Example #3
0
 private void updateStatus(ProcessStatistics.process_statistics data)
 {
     //System.Diagnostics.Debug.WriteLine("updateStatus: " + data.dumpStatistics());
     if (this.onUpdate != null)
         this.onUpdate(this, data);
 }
        void addData(ProcessStatistics.process_statistics procStats)
        {
            if (this.dataGridView1.InvokeRequired)
            {
                addDataCallback d = new addDataCallback(addData);
                this.Invoke(d, new object[] { procStats });
            }
            else
            {
                dataGridView1.SuspendLayout();
                //enqueue data to be saved to sqlite
                dataQueue.Enqueue(procStats);

                if (bAllowGUIupdate)
                {
                    //dataAccess.addSqlData(procStats);

                    //dtProcesses.Rows.Clear();

                    dataAccess.addData(procStats);


                    //release queue data
                    dataAccess.waitHandle.Set();

                    //object[] o = new object[7]{ procUsage.procStatistics. .procStatistics. [i].sApp, eventEntries[i].sArg, eventEntries[i].sEvent, 
                    //        eventEntries[i].sStartTime, eventEntries[i].sEndTime, eventEntries[i].sType, eventEntries[i].sHandle };
                }
                dataGridView1.Refresh();
                dataGridView1.ResumeLayout();
            }
        }