Ejemplo n.º 1
0
        /// <summary>
        /// 选择绘图
        /// </summary>
        /// <param name="sender">事件发送者</param>
        /// <param name="e">事件参数</param>
        private void innerChartBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            innerChartPath = innerChartBox.Text;
            string    id        = idTable[innerChartPath].ToString();
            Hashtable infoTable = null;

            lDescription.Text = "子绘图描述";

            if (diagramTable[id] == null)
            {
                DataBaseManager dataBaseManager = DataBaseManager.GetDataBaseManager();
                infoTable        = dataBaseManager.GetDiagramData(id) as Hashtable;
                diagramTable[id] = infoTable;
            }
            else
            {
                infoTable = diagramTable[id] as Hashtable;
            }

            if (infoTable != null)
            {
                Hashtable customData = infoTable["customData"] as Hashtable;

                if (customData != null)
                {
                    string description = customData["description"] as string;

                    if (description != null)
                    {
                        lDescription.Text = description;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 重新加载流程图
        /// </summary>
        private void ReLoadFlowChart()
        {
            Hashtable args = dataBaseManager.GetDiagramData(id) as Hashtable;

            if (args != null) // 流程图数据不为空
            {
                graphManager.SetArguments(args["graphData"] as Hashtable);
                dataManager.SetArguments(args["logicData"] as Hashtable);
                flowChartInteractor.SetArguments(args["flowChartInteractData"] as Hashtable);
            }

            editTime = dataBaseManager.GetDiagramEditTime(id);
            version  = dataBaseManager.GetDiagramVersion(id);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 查找引用
        /// </summary>
        /// <param name="sender">事件发送者</param>
        /// <param name="e">事件参数</param>
        private void bSearchReference_Click(object sender, EventArgs e)
        {
            Node currentNode = innerChartTree.SelectedNode;

            if (currentNode != null)
            {
                diagramInfoView.Rows.Clear();

                string    innerChartName = currentNode.Text;
                DataTable infoTable      = dataBaseManager.GetDiagramInformation(diagramClass);

                DataRow[]    rows         = infoTable.Select("IsFolder = 0");
                ProgressForm progressForm = new ProgressForm(0, rows.Length);
                progressForm.Show();

                for (int i = 0; i < rows.Length; i++)
                {
                    DataRow dataRow   = rows[i];
                    string  id        = dataRow["ID"].ToString();
                    string  path      = dataRow["FullPath"].ToString();
                    string  version   = dataRow["Version"].ToString();
                    int     diagramID = int.Parse(id);

                    progressForm.ShowProgress(i + 1, string.Format("检索绘图 {0} ...", path));

                    List <SlotContainer> nodeList = new List <SlotContainer>();

                    if (diagramInfoDictionary.ContainsKey(diagramID))
                    {
                        DiagramInfo diagramInfo = diagramInfoDictionary[diagramID];

                        if (diagramInfo.Version == int.Parse(version))
                        {
                            nodeList = diagramInfo.NodeList;
                        }
                        else
                        {
                            Hashtable diagramData = dataBaseManager.GetDiagramData(id) as Hashtable;

                            if (diagramData != null)
                            {
                                Hashtable graphData = diagramData["graphData"] as Hashtable;
                                nodeList             = graphData["slotContainerList"] as List <SlotContainer>;
                                diagramInfo.Version  = int.Parse(version);
                                diagramInfo.NodeList = nodeList;
                            }
                        }
                    }
                    else
                    {
                        Hashtable diagramData = dataBaseManager.GetDiagramData(id) as Hashtable;

                        if (diagramData != null && !string.IsNullOrEmpty(version))
                        {
                            Hashtable graphData = diagramData["graphData"] as Hashtable;
                            nodeList = graphData["slotContainerList"] as List <SlotContainer>;
                            DiagramInfo diagramInfo = new DiagramInfo(int.Parse(version), nodeList);
                            diagramInfoDictionary[diagramID] = diagramInfo;
                        }
                    }

                    foreach (SlotContainer node in nodeList)
                    {
                        if (node is InnerChart && node.Text == innerChartName)
                        {
                            diagramInfoView.Rows.Add(1);
                            DataGridViewRow newRow = diagramInfoView.Rows[diagramInfoView.Rows.Count - 1];
                            newRow.Cells["Path"].Value   = path;
                            newRow.Cells["NodeID"].Value = node.ID.ToString();
                            newRow.Tag = id;
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("请先选择要查找引用的子绘图", "查找引用",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }