Exemple #1
0
        public void BlockDelete(Coordinates coords)
        {
            ElementBase element = null;

            try
            {
                element = OTCContext.Project.Elements.Get(this.Switchboard, coords);
                if (element != null)
                {
                    OTCContext.Project.Remove(element);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                this.RepaintCoordinates(element != null ? element.GetUsedCoordinates() : new Coordinates[] { coords });
                this.SelectCell(coords);
            }
        }