Beispiel #1
0
        private void AddNewLocation(SavedLoc loc)
        {
            ExpandedTreeNode node = new ExpandedTreeNode(loc.Name);

            node.AssociatedObject = loc;
            node.Nodes.Add(String.Format("X: {0}", loc.X));
            node.Nodes.Add(String.Format("Y: {0}", loc.Y));
            node.Nodes.Add(String.Format("Z: {0}", loc.Z));
            node.Nodes.Add(String.Format("Key: {0}", loc.Key));
            this.lstSavedLocs.Nodes.Add(node);
        }
Beispiel #2
0
        private void lstSavedLocs_DoubleClick(object sender, System.EventArgs e)
        {
            if (this.lstSavedLocs.SelectedNode is ExpandedTreeNode)
            {
                ExpandedTreeNode node = (ExpandedTreeNode)this.lstSavedLocs.SelectedNode;

                if (this.mX != null & this.mY != null & this.mZ != null & node.AssociatedObject is SavedLoc)
                {
                    SavedLoc loc = (SavedLoc)node.AssociatedObject;
                    this.mX.SetValue(loc.X);
                    this.mY.SetValue(loc.Y);
                    this.mZ.SetValue(loc.Z);
                }
            }
        }
Beispiel #3
0
        private void menuItem1_Click(object sender, System.EventArgs e)
        {
            if (this.lstSavedLocs.SelectedNode is ExpandedTreeNode)
            {
                frmLocEdit       editForm = new frmLocEdit();
                ExpandedTreeNode node     = (ExpandedTreeNode)this.lstSavedLocs.SelectedNode;

                SavedLoc loc = (SavedLoc)node.AssociatedObject;

                editForm.editName = loc.Name;
                editForm.editX    = loc.X.ToString();
                editForm.editY    = loc.Y.ToString();
                editForm.editZ    = loc.Z.ToString();
                editForm.ShowDialog();
            }

            LoadLocationsFromFile();
        }
Beispiel #4
0
 private void AddNewLocation(SavedLoc loc)
 {
     ExpandedTreeNode node = new ExpandedTreeNode(loc.Name);
     node.AssociatedObject = loc;
     node.Nodes.Add(String.Format("X: {0}", loc.X));
     node.Nodes.Add(String.Format("Y: {0}", loc.Y));
     node.Nodes.Add(String.Format("Z: {0}", loc.Z));
     node.Nodes.Add(String.Format("Key: {0}",loc.Key));
     this.lstSavedLocs.Nodes.Add(node);
 }