Ejemplo n.º 1
0
        /// <summary>
        /// Called to display the properties of the currently selected node
        /// </summary>
        /// <param name="selectedNode"></param>
        protected bool EditLocation(AssetGroup parentLocation, AssetGroup location)
        {
            // ...and display the location editing form
            FormUserLocation form = new FormUserLocation(parentLocation, location);

            return(form.ShowDialog() == DialogResult.OK);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a new location as a child of the location currently selected in the TreeView
        /// </summary>
        public void AddLocation()
        {
            if (locationsTree.SelectedNodes.Count == 0)
            {
                return;
            }
            //
            UltraTreeNode selectedNode = locationsTree.SelectedNodes[0];

            AssetGroup parentGroup = selectedNode.Tag as AssetGroup;
            AssetGroup newGroup    = new AssetGroup();

            newGroup.GroupType = AssetGroup.GROUPTYPE.userlocation;
            newGroup.ParentID  = parentGroup.GroupID;
            //
            FormUserLocation form = new FormUserLocation(parentGroup, newGroup);

            if (form.ShowDialog() == DialogResult.OK)
            {
                UltraTreeNode newNode = selectedNode.Nodes.Add(newGroup.FullName, newGroup.Name);

                newNode.Override.NodeAppearance.Image         = Properties.Resources.location_16;
                newNode.Override.ExpandedNodeAppearance.Image = Properties.Resources.location_16;
                newNode.Tag = newGroup;
                newNode.BringIntoView();

                // Add the new location to the list view also
                PopulateListView(selectedNode);
            }
        }