Exemplo n.º 1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            DialogResult result3 = MessageBox.Show(gStr.gsCompletelyDeleteBoundary,
                                                   gStr.gsDeleteForSure,
                                                   MessageBoxButtons.YesNo,
                                                   MessageBoxIcon.Question,
                                                   MessageBoxDefaultButton.Button2);

            if (result3 == DialogResult.Yes)
            {
                btnLeftRight.Enabled = false;
                btnGo.Enabled        = false;
                btnDelete.Enabled    = false;
                nudBndOffset.Enabled = false;

                if (mf.bnd.bndArr.Count > mf.bnd.boundarySelected)
                {
                    mf.bnd.bndArr.RemoveAt(mf.bnd.boundarySelected);
                }

                mf.FileSaveBoundary();


                mf.bnd.boundarySelected = -1;
                Selectedreset           = true;
                mf.fd.UpdateFieldBoundaryGUIAreas();

                UpdateChart();
            }
            else
            {
                mf.TimedMessageBox(1500, gStr.gsNothingDeleted, gStr.gsActionHasBeenCancelled);
            }
        }
Exemplo n.º 2
0
        private void btnStop_Click(object sender, EventArgs e)
        {
            if (mf.bnd.bndBeingMadePts.Count > 2)
            {
                mf.bnd.bndArr.Add(new CBoundaryLines());

                for (int i = 0; i < mf.bnd.bndBeingMadePts.Count; i++)
                {
                    mf.bnd.bndArr[mf.bnd.boundarySelected].bndLine.Add(mf.bnd.bndBeingMadePts[i]);
                }

                mf.bnd.bndArr[mf.bnd.boundarySelected].PreCalcBoundaryLines();
                mf.bnd.bndArr[mf.bnd.boundarySelected].FixBoundaryLine(mf.bnd.boundarySelected);
                mf.bnd.bndArr[mf.bnd.boundarySelected].PreCalcBoundaryLines();
                mf.bnd.bndArr[mf.bnd.boundarySelected].isSet = true;
                mf.bnd.bndArr[mf.bnd.boundarySelected].CalculateBoundaryArea();
                mf.fd.UpdateFieldBoundaryGUIAreas();
            }

            //stop it all for adding
            mf.bnd.isOkToAddPoints = false;
            mf.bnd.isBndBeingMade  = false;

            //turn lines made from boundaries
            mf.CalculateMinMax();
            mf.FileSaveBoundary();

            mf.bnd.bndBeingMadePts.Clear();
            //close window
            Close();
        }