Ejemplo n.º 1
0
        /// <summary>
        /// Add RF Data to the grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ReceivedRFOut(object sender, EventArgs e)
        {
            RFData rf     = ((RFData)e);
            string output = rf.ToString();

            lock (lockme)
            {
                // Have we seen this one before?
                DataGridViewRow row = FindRowHash(rf.HashKey);

                if (row == null)
                {
                    DataGridViewRow newrow = new DataGridViewRow();
                    int             rowID  = dataGridView1.Rows.Add(newrow);
                    row = dataGridView1.Rows[rowID];
                    row.Cells["Key"].Value = rf.HashKey;
                }

                foreach (var field in rf.Fields)
                {
                    if (false == dataGridView1.Columns.Contains(field.Key))
                    {
                        dataGridView1.Columns.Add(field.Key, field.Key);
                    }

                    row.Cells[field.Key].Value = field.Value;
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Data received from rflink
        /// </summary>
        void ReceivedRFOut(object sender, EventArgs e)
        {
            RFData rf = e as RFData;

            if (PackageHost.GetSettingValue <bool>("Log"))
            {
                PackageHost.WriteInfo("RfLink data receive : {0}", rf.ToString());
            }

            // Push state object
            if (rf.Fields.ContainsKey("ID"))
            {
                var param = this.GetCustomSoParams(rf.Fields["ID"]);
                PackageHost.PushStateObject(param.Item1, rf.Fields, lifetime: param.Item2);
            }
        }