Exemple #1
0
        private void OnLinear(object sender, EventArgs e)
        {
            ToolStripDropDownItem ctrl = sender as ToolStripDropDownItem;
            ContextMenuStrip      cms  = ctrl.Owner as ContextMenuStrip;
            TreeView     tre           = cms.SourceControl as TreeView;
            TreeNodeItem nodDEM        = tre.SelectedNode as TreeNodeItem;

            LinearExtraction.frmLinearExtractionProperties frm = new LinearExtraction.frmLinearExtractionProperties(nodDEM.Item as GCDProjectItem);
            EditTreeItem(frm);
        }
        public override void OnAdd(object sender, EventArgs e)
        {
            if (ProjectManager.Project.ProfileRoutes.Count < 1)
            {
                MessageBox.Show("You must create at least one profile route before you can perform a linear extraction.", "Insufficient Profile Routes", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            LinearExtraction.frmLinearExtractionProperties frm = new LinearExtraction.frmLinearExtractionProperties(Surface);
            EditTreeItem(frm);
        }
Exemple #3
0
        public void OnEdit(object sender, EventArgs e)
        {
            TreeNodeItem node = sender as TreeNodeItem;
            Form         frm  = null;

            if (Item is AssocSurface)
            {
                AssocSurface assoc = Item as AssocSurface;
                frm = new SurveyLibrary.frmAssociatedSurface(assoc.DEM, assoc);
            }
            else if (Item is ErrorSurface && ((ErrorSurface)Item).Surf is DEMSurvey)
            {
                ErrorSurface err = Item as ErrorSurface;
                if (err.ErrorProperties.Count < 1)
                {
                    frm = new SurveyLibrary.frmSurfaceProperties(Item as GCDProjectRasterItem, true);
                }
                else
                {
                    if (err.Mask == null)
                    {
                        frm = new SurveyLibrary.ErrorSurfaces.frmSingleMethodError(err);
                    }
                    else
                    {
                        frm = new SurveyLibrary.ErrorSurfaces.frmMultiMethodError(err);
                    }
                }
            }
            else if (Item is GCDCore.Project.ProfileRoutes.ProfileRoute)
            {
                GCDCore.Project.ProfileRoutes.ProfileRoute route = Item as GCDCore.Project.ProfileRoutes.ProfileRoute;
                frm = new UserInterface.ProfileRoutes.frmProfileRouteProperties(route.ProfileRouteType, route);
            }
            else if (Item is GCDCore.Project.Masks.DirectionalMask)
            {
                frm = new Masks.frmDirectionalMaskProps(Item as GCDCore.Project.Masks.DirectionalMask);
            }
            else if (Item is GCDCore.Project.Masks.AOIMask)
            {
                frm = new Masks.frmAOIProperties(Item as GCDCore.Project.Masks.AOIMask);
            }
            else if (Item is GCDCore.Project.Masks.RegularMask)
            {
                frm = new Masks.frmMaskProperties(Item as GCDCore.Project.Masks.RegularMask);
            }
            else if (Item is GCDCore.Project.LinearExtraction.LinearExtraction)
            {
                frm = new LinearExtraction.frmLinearExtractionProperties(Item as GCDCore.Project.LinearExtraction.LinearExtraction);
            }
            else
            {
                // Generic raster properties form
                if (Item is GCDProjectRasterItem)
                {
                    frm = new SurveyLibrary.frmSurfaceProperties(Item as GCDProjectRasterItem, true);
                }
                else
                {
                    throw new NotImplementedException("Unhandled editing of project type");
                }
            }

            if (frm is Form)
            {
                EditTreeItem(frm);
            }
        }