Beispiel #1
0
        public static void ShowGardenAreaCreationDialog(List <GardenPoint> points, System.Action <GardenArea> action)
        {
            GardenAreaCreationDialog dialog = new GardenAreaCreationDialog("Create method area");

            dialog.CreateButton.Clicked += (object sender, System.EventArgs e) =>
            {
                GardenArea area = new Garden.Garden(dialog.NameEntry.Text, dialog.DescrEntry.Text);
                dialog.SetValuesForCreation(area, points);
                action(area);
                GardenDrawingArea.ActiveInstance?.Draw();
                dialog.Destroy();
            };
        }
Beispiel #2
0
        public static void ShowGardenAreaEditDialog(GardenArea area)
        {
            string title = "Edit method area '" + area.Name + "'";

            if (area is Garden.Garden)
            {
                title = "Edit garden '" + area.Name + "'";
            }
            else if (area is Planting)
            {
                title = "Edit planting '" + area.Name + "'";
            }
            GardenAreaCreationDialog dialog = new GardenAreaCreationDialog(title);

            dialog.SetValuesForEdit(area);
        }