Example #1
0
        private void pictureBox_controlData_Click(object sender, EventArgs e)
        {
            if (nowEditItem == null)
            {
                MessageBox.Show("can not find edit Parameter Data", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            IRunTimeStaticData editRunTimeStaticData = (IRunTimeStaticData)nowEditItem.Tag;

            if (sender == pb_edit)
            {
                if (!editRunTimeStaticData.DataSet(tb_valueAdd.Text))
                {
                    MessageBox.Show(string.Format("{0} is illegal for this RunTimeStaticData", tb_valueAdd.Text), "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
            }
            else if (sender == pb_next)
            {
                editRunTimeStaticData.DataMoveNext();
            }
            else if (sender == pb_reset)
            {
                editRunTimeStaticData.DataReset();
            }
            else
            {
                MessageBox.Show("can not find edit data", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
            FreeHttpWindow.MarkRuleItem(nowEditItem);
            nowEditItem.SubItems[2].Text = tb_valueAdd.Text = editRunTimeStaticData.DataCurrent();
        }
        public bool SetActuatorStaticData(string key, string value)
        {
            if (actuatorStaticDataCollection == null)
            {
                return(false);
            }
            IRunTimeStaticData nowStaticData = actuatorStaticDataCollection[key];

            if (nowStaticData != null)
            {
                nowStaticData.DataMoveNext();
                return(actuatorStaticDataCollection.SetStaticDataValue(key, value));
            }
            else
            {
                return(actuatorStaticDataCollection.AddStaticDataKey(key, new MyStaticDataValue(value)));
            }
        }