Example #1
0
        /// <summary>
        /// 检查数据是否有效
        /// </summary>
        public void CheckDataValid()
        {
            string requestReloadID = dataManager.RequestReloadID;

            if (requestReloadID != "")
            {
                DialogResult result = MessageBox.Show("发现绘图部分数据在程序外发生改变,需要重新编辑更新!", "数据一致性检查",
                                                      MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result == DialogResult.OK)
                {
                    string[]  idArray  = requestReloadID.Split(new char[] { ',' });
                    Hashtable argTable = new Hashtable();
                    argTable["globe_args"]      = dataManager.GlobeArgs;
                    argTable["requestReloadID"] = "";
                    argTable["forceReload"]     = "1";

                    foreach (string id in idArray)
                    {
                        GraphElement graphElement = dataManager.FindGraphElementByID(int.Parse(id));

                        if (graphElement != null)
                        {
                            DataElement dataElement = dataManager.FindDataElementByID(int.Parse(id));
                            dataElement.ReloadData(argTable);
                            graphManager.SelectGraphElement(graphElement, true);
                            graphManager.EditDataElement(graphElement);
                        }
                    }
                }
            }
        }