예제 #1
0
        /// <summary>
        /// 添加路径
        /// </summary>
        /// <param name="sender">事件发送者</param>
        /// <param name="e">事件参数</param>
        private void buttonX2_Click(object sender, EventArgs e)
        {
            InputForm iForm = new InputForm("新建路径", "请输入路径名称");

            if (iForm.ShowDialog() == DialogResult.OK)
            {
                int newWayPointSet = 0;
                m_doc.DocLogical.DecoratedAddOneWayPointSet(ref newWayPointSet, iForm.InputText);

                int         index      = patrolTree.Nodes.Count;
                _AtlObjInfo patrolInfo = new _AtlObjInfo();
                m_doc.DocLogical.GetObjDisplayInfo("WayPointSet", index, 0, ref name, ref nickName, ref hasScript, ref representObj, ref logicObj, ref templateID);
                m_doc.DocLogical.GetSetObjInfo("WayPointSet", ref patrolInfo, logicObj, 1);

                Node patrolNode = new Node();
                patrolNode.Text = string.Format("{0} ({1})", iForm.InputText, index + 1);
                patrolNode.Tag  = patrolInfo;
                patrolTree.Nodes.Add(patrolNode);
                patrolTree.SelectedNode = patrolNode;

                // 刷新路径数据
                InitPatrolPathTable();
            }
        }
예제 #2
0
        /// <summary>
        /// 添加路径
        /// </summary>
        /// <param name="sender">事件发送者</param>
        /// <param name="e">事件参数</param>
        private void buttonX2_Click(object sender, EventArgs e)
        {
            InputForm iForm = new InputForm("新建路径", "请输入路径名称");

            if (iForm.ShowDialog() == DialogResult.OK)
            {
                int newWayPointSet = 0;
                m_doc.DocLogical.DecoratedAddOneWayPointSet(ref newWayPointSet, iForm.InputText);

                int index = patrolTree.Nodes.Count;
                _AtlObjInfo patrolInfo = new _AtlObjInfo();
                m_doc.DocLogical.GetObjDisplayInfo("WayPointSet", index, 0, ref name, ref nickName, ref hasScript, ref representObj, ref logicObj, ref templateID);
                m_doc.DocLogical.GetSetObjInfo("WayPointSet", ref patrolInfo, logicObj, 1);

                Node patrolNode = new Node();
                patrolNode.Text = string.Format("{0} ({1})", iForm.InputText, index + 1);
                patrolNode.Tag = patrolInfo;
                patrolTree.Nodes.Add(patrolNode);
                patrolTree.SelectedNode = patrolNode;

                // 刷新路径数据
                InitPatrolPathTable();
            }
        }