Exemplo n.º 1
0
        }                                                    // could also be DoD

        public LinearExtractionGrp(TreeNodeCollection nodParents, GCDProjectItem parentSurface, DirectoryInfo dir, IContainer container)
            : base(nodParents, "Linear Extractions", "Linear Extraction", "Linear Extractions", dir, container)
        {
            Surface = parentSurface;

            ContextMenuStrip.Items.RemoveAt(0);
            ContextMenuStrip.Items.Insert(0, new ToolStripMenuItem("Calculate Linear Extraction From Profile Route", Properties.Resources.Add, OnAdd));

            LoadChildNodes();
        }
Exemplo n.º 2
0
        protected DialogResult EditTreeItem(Form frm, bool treeReload = true)
        {
            if (frm == null)
            {
                return(DialogResult.Abort);
            }

            DialogResult eResult = DialogResult.OK;

            try
            {
                eResult = frm.ShowDialog();
                if (eResult == DialogResult.OK && treeReload)
                {
                    IProjectItemForm iForm = frm as IProjectItemForm;
                    if (iForm != null)
                    {
                        // Get the GCD project item that was just added or edited
                        GCDProjectItem changedItem = iForm.GCDProjectItem;

                        // Selected this node if it is an item node and was just edited
                        if (this is TreeNodeItem && ((TreeNodeItem)this).Item.Equals(changedItem))
                        {
                            Text = changedItem.Name;
                        }
                        else
                        {
                            // Polymorphic loading of relevant child nodes
                            LoadChildNodes();

                            // Loop through the child nodes and select the item that was just added
                            foreach (TreeNode childNode in Nodes)
                            {
                                if (childNode is TreeNodeItem)
                                {
                                    if (((TreeNodeItem)childNode).Item.Equals(changedItem))
                                    {
                                        TreeView.SelectedNode = childNode;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GCDException.HandleException(ex, "Error Editing GCD Project Item");
            }

            return(eResult);
        }
Exemplo n.º 3
0
        public GridViewGCDProjectItem(GCDProjectItem item)
            : base(item.Noun, string.Empty)
        {
            ProjectItem = item;

            if (item is GCDProjectRasterItem)
            {
                Value = ProjectManager.Project.GetRelativePath(((GCDProjectRasterItem)item).Raster.GISFileInfo);
            }
            else if (item is GCDProjectVectorItem)
            {
                Value = ProjectManager.Project.GetRelativePath(((GCDProjectVectorItem)item).Vector.GISFileInfo);
            }
        }
Exemplo n.º 4
0
        public GridViewGCDProjectItem(string prop, string value, GCDProjectItem item)
            : base(prop, value)
        {
            ProjectItem = item;

            if (item is GCDProjectRasterItem)
            {
                Value = ProjectManager.Project.GetRelativePath(((GCDProjectRasterItem)item).Raster.GISFileInfo);
            }
            else if (item is GCDProjectVectorItem)
            {
                Value = ProjectManager.Project.GetRelativePath(((GCDProjectVectorItem)item).Vector.GISFileInfo);
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor when a custom name is required for the item (e.g. Error Surfaces with default)
 /// </summary>
 /// <param name="customName"></param>
 /// <param name="item"></param>
 /// <param name="imageindex"></param>
 /// <param name="container"></param>
 public TreeNodeItem(string customName, GCDProjectItem item, int imageindex, IContainer container)
     : base(customName, item.Noun, item.Noun, imageindex)
 {
     Item = item;
     Init(container);
 }
Exemplo n.º 6
0
 public frmLinearExtractionProperties(GCDProjectItem surface)
 {
     InitializeComponent();
     ElevationSurface = surface;
 }
Exemplo n.º 7
0
 public MorphologicalItem(GCDProjectItem item, IContainer container)
     : base(item, 11, container)
 {
     ContextMenuStrip.Items.RemoveAt(0);
     ContextMenuStrip.Items.Insert(0, new ToolStripMenuItem("View Morphological Analysis Results", Properties.Resources.GCD, OnViewResults));
 }