private ListViewItem AddEntry(StateGraphDocument.StateGraphEntry entry) { ListViewItem item = new ListViewItem(entry.StateName); item.SubItems.Add(entry.Graph != null ? entry.Graph.Name : "None"); item.Tag = entry; listViewStateEntries.Items.Add(item); return(item); }
private void UpdateEntries() { foreach (ListViewItem item in listViewStateEntries.Items) { StateGraphDocument.StateGraphEntry entry = (StateGraphDocument.StateGraphEntry)item.Tag; item.SubItems[0].Text = entry.StateName; item.SubItems[1].Text = entry.Graph != null ? entry.Graph.Name : "None"; } }
private void copySetMetaNodeToolStripMenuItem_Click(object sender, EventArgs e) { if (listViewStateEntries.SelectedItems.Count > 0) { StateGraphDocument.StateGraphEntry entry = (StateGraphDocument.StateGraphEntry)listViewStateEntries.SelectedItems[0].Tag; SetMetaStateNodeConfig config = new SetMetaStateNodeConfig(); config.MetaName = textBoxMetaName.Text; config.Value = entry.StateName; config.ResetStateOnMatch = true; LibraryNodeConfig libNode = new LibraryNodeConfig(typeof(SetMetaStateNode), String.Format(Properties.Resources.StateGraphDocumentControl_SetStateName, entry.StateName), config); libNode.Label = String.Format(Properties.Resources.StateGraphDocumentControl_SetStateName, entry.StateName); NetGraphDocumentControl.CopyNode(libNode); } }