/// <summary> /// Loads an item visually /// </summary> /// <param name="listViewItem"></param> private void LoadItem(ListViewItem pLVI) { CommandRunExt vCRE = (CommandRunExt)pLVI.Tag; txbLabel.Text = vCRE.mLabel; txbCommand.Text = vCRE.mCommand; txbParam.Text = vCRE.mParams; txbBody.Text = vCRE.mPacketBody; mCurrentCRE = vCRE; }
private void btnNew_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txbLastToken.Text)) { MessageBox.Show("Need a identifier/RFID/message body."); return; } CommandRunExt vCRE = new CommandRunExt(); vCRE.mPacketBody = txbLastToken.Text; vCRE.mLabel = "New token!"; ListViewItem vLVI = new ListViewItem(vCRE.mLabel, IMGINDEX_OTHER); vLVI.Tag = vCRE; this.lvItems.Items.Add(vLVI); this.mCREList.Add(vCRE); }
/// <summary> /// Reads the data from on disk xml file /// </summary> private void ReadCommandsFromXML() { XmlDocument vDoc = new XmlDocument(); vDoc.Load(BasePacketInterpreter.XmlCommandFileName); foreach (XmlNode vSubNode in vDoc.SelectNodes(EXTENDED_XMLPATH)) { CommandRunExt vCRE = new CommandRunExt(); vCRE.mLabel = vSubNode.Attributes["label"].Value; vCRE.mPacketSubtype = vSubNode.Attributes["packetSubtype"].Value; vCRE.mPacketBody = vSubNode.Attributes["packetBody"].Value; vCRE.mCommand = vSubNode.Attributes["command"].Value; if (vSubNode.Attributes["params"].Value != string.Empty) { vCRE.mParams = vSubNode.Attributes["params"].Value; } vCRE.mMustConfirm = Convert.ToBoolean(vSubNode.Attributes["mustConfirm"].Value); mCREList.Add(vCRE); } }