Exemplo n.º 1
0
        /// <summary>
        /// 重新分配图元的ID
        /// </summary>
        /// <param name="sender">事件发送者</param>
        /// <param name="e">事件参数</param>
        protected virtual void ResetGraphElementID(object sender, EventArgs e)
        {
            if (MessageBox.Show("确定重新分配图元ID吗?", "重新分配图元ID",
                                MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                DocumentManager  documentManager  = DocumentManager.GetDocumentManager();
                FlowChartManager flowChartManager = documentManager.CurrentFlowChartManager;
                GraphManager     graphManager     = flowChartManager.CurrentGraphManager;
                DataManager      dataManager      = flowChartManager.CurrentDataManager;

                graphManager.ResetGraphElementID();
                dataManager.ResetDataElementID();
                graphManager.RefreshCanvas();
            }
        }