ListViewItem makeRow(NodeBase n) { if (n is NodeGVL) { ListViewItem lvi = new ListViewItem(new string[] { (n.IecAddress == "") ? n.Name : n.IecAddress, "GODatSet", "", "Matches SCL: " + (n as NodeGVL).MatchesSCL + ", GoID = " + (n as NodeGVL).GoID + " DatSet = " + (n as NodeGVL).DatSet + " Addr = " + (n as NodeGVL).Addr + " APPID = " + (n as NodeGVL).APPID }); (n as NodeGVL).ValueTag = lvi; return(lvi); } else if (n is NodeGData) { string val = (n as NodeGData).StringValue; string address = n.CommAddress.Domain.ToString() + ((n.CommAddress.Variable.ToString() != "") ? ("/" + n.CommAddress.Variable.ToString().Replace("$", "/")) : ""); ListViewItem lvi = new ListViewItem(new string[] { address, (n as NodeGData).DataType.ToString(), val, ((n as NodeGData).Tag as Data).Description }); (n as NodeGData).ValueChanged += new EventHandler(Node_ValueChanged); (n as NodeGData).ValueTag = lvi; return(lvi); } else if (n is NodeVL) { return(new ListViewItem(new string[] { n.IecAddress, n.ToString(), "", "Deletable = " + (n as NodeVL).Deletable.ToString() + ", " + "Defined = " + (n as NodeVL).Defined.ToString() })); } else if (n != null) { return(new ListViewItem(new string[] { n.IecAddress, n.ToString(), "", "Dom = " + n.CommAddress.Domain + " Var = " + n.CommAddress.Variable })); } return(null); }
ListViewItem makeRow(NodeBase n) { if (n is NodeData) { string val = (n as NodeData).StringValue; ListViewItem lvi = new ListViewItem(new string[] { n.Address, (n as NodeData).DataType.ToString(), val, "Dom = " + n.CommAddress.Domain + " Var = " + n.CommAddress.Variable }); (n as NodeData).ValueChanged += new EventHandler(Node_ValueChanged); (n as NodeData).ValueTag = lvi; //lvi.SubItems[2].Text; return(lvi); } else if (n is NodeVL) { return(new ListViewItem(new string[] { n.Address, n.ToString(), "", "Deletable = " + (n as NodeVL).Deletable.ToString() + ", " + "Defined = " + (n as NodeVL).Defined.ToString() })); } else if (n is NodeFile) { string val; if ((n as NodeFile).isDir) { val = "Dir"; } else { val = (n as NodeFile).ReportedSize.ToString(); } return(new ListViewItem(new string[] { n.Name, n.ToString(), val, (n as NodeFile).FullName })); } else if (n != null) { return(new ListViewItem(new string[] { n.Address, n.ToString(), "", "Dom = " + n.CommAddress.Domain + " Var = " + n.CommAddress.Variable })); } return(null); }