Beispiel #1
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);
            }
        }
Beispiel #2
0
 public void OnAddDirectionalMask(object sender, EventArgs e)
 {
     Masks.frmDirectionalMaskProps frm = new Masks.frmDirectionalMaskProps();
     EditTreeItem(frm);
 }