private void btnConfirm_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("คุณต้องการที่จะสร้างพื้นที่ควบคุมสูงที่ตำแหน่งเหล่านี้ใช่หรือไม่", "อาณาเขต", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialogResult == DialogResult.Yes) { //create a real polygon which is not a preview polygon PolygonManager.CreatePolygon(points); //Create an object to collect data of polygon var polygonData = new ObjectsManager.PolygonDataCollection(txtName.Text, points, polygon); string id = PolygonCollectionManager.GenerateId(); //Add to dict of polygon PolygonCollectionManager.Add(id, polygonData); //reset index value index = 1; //reset attributes Reset(); instanceMain.isRaClicked = false; instanceMain.SetPolygonFuncClick(false); instanceMain._pointsPoly.Clear(); } }
private void AddDataToCollection(string name, List <PointLatLng> points, string statusEx, string statusIn, GMapPolygon polygon) { string id = collectionManager.GenerateId(); var polygonObj = new ObjectsManager.PolygonDataCollection(name, points, polygon, statusEx, statusIn); collectionManager.Add(id, polygonObj); Debug.WriteLine(polygonObj._point.Count); main._pointsPoly.Clear(); }