Exemplo n.º 1
0
 public void ClearPaint()
 {
     ColorClear();
     this.ArryQuestNode.Clear();
     this.CurrentNode = null;
     this.Refresh();
 }
Exemplo n.º 2
0
 public void AddNode(OneNode node)
 {
     if (node != null)
     {
         ArryQuestNode.Add(node);
     }
 }
Exemplo n.º 3
0
        public bool reloadAll(string keyword)
        {
            if (!bHasInitHashTable)
            {
                InitHashtable();
                bHasInitHashTable = true;
            }

            panelEx1.ClearPaint();

            string[] keywords = keyword.Split(new char[] { ',' });
            if (keywords.Length != 2)
            {
                MessageBox.Show("错误的reloadAll参数");
            }

            int questid = Convert.ToInt32(keywords[1]);

            if (questid < 0)
            {
                return(false);
            }
            QuestId       = questid;
            nodeRoot.Text = GetQuestName(questid);
            reloadNodes(questid);
            nodeCurrent = nodeRoot.Nodes[0].Tag as OneNode;
            UpdateStatus();
            dgvQuestInfo.DataSource = GetQuestMoreInfo();

            return(true);
        }
Exemplo n.º 4
0
        private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e)
        {
            DevComponents.AdvTree.Node advTreeNode = e.Node;
            if (advTreeNode == nodeRoot)
            {
                return;
            }

            OneNode nodeTag = advTreeNode.Tag as OneNode;

            nodeCurrent          = nodeTag;
            panelEx1.CurrentNode = nodeCurrent;

            UpdateStatus();
        }
Exemplo n.º 5
0
        private void SaveOneNode(OneNode node)
        {
            if (node.IsChanged)
            {
                string strKey            = node.ColumnNameKey;
                string ColumnName_nMapId = string.Format("{0}_MapId", strKey);
                string ColumnName_Areas  = string.Format("{0}_Areas", strKey);

                string sql = string.Format(
                    " update {0} set {1} = {2}, {3} = '{4}' where QuestId ={5}",
                    QuestGuideTableName, ColumnName_nMapId, node.MapId, ColumnName_Areas, node.StringGrayIds, QuestId
                    );
                Helper.SqlNoneQureyExcute(Conn, sql);
                node.BackUp();
            }
        }
Exemplo n.º 6
0
        private void AddRegionNodes(string[] columns, DataRow row, Color treeColor, bool needEdit, TemplateType ttype)
        {
            string ColumnName_MapID;
            string ColumnName_Areas;

            int    nValue_MapID;
            string strValue_Areas;

            foreach (string columnkey in columns)
            {
                ColumnName_MapID = string.Format("{0}_MapId", columnkey);
                ColumnName_Areas = string.Format("{0}_Areas", columnkey);

                if (!needEdit &&
                    (row.IsNull(ColumnName_MapID) || Convert.ToInt32(row[ColumnName_MapID]) == 0)
                    )
                {
                    continue;
                }
                nValue_MapID   = row.IsNull(ColumnName_MapID) ? 0 : Convert.ToInt32(row[ColumnName_MapID]);
                strValue_Areas = row.IsNull(ColumnName_Areas) ? "" : row[ColumnName_Areas].ToString();

                if (nValue_MapID == 0)
                {
                    nValue_MapID = DefaultMapId;
                }

                OneNode nodeTag = new OneNode();
                nodeTag.Init(nValue_MapID, strValue_Areas, ttype, columnkey);
                nodeTag.CanEdit = needEdit;
                SetBrothers(ref nodeTag, columnkey);
                MapConfig config = htMapConfig[nValue_MapID] as MapConfig;
                if (config != null)
                {
                    nodeTag.imageMap = config.TagImage;
                }
                DevComponents.AdvTree.Node newTreenode = new DevComponents.AdvTree.Node();
                newTreenode.Text  = htColumnNameDisplay[columnkey].ToString();
                newTreenode.Tag   = nodeTag;
                newTreenode.Style = new ElementStyle(); newTreenode.Style.TextColor = treeColor;

                nodeRoot.Nodes.Add(newTreenode);
                ArryNodes.Add(nodeTag);
            }
        }
Exemplo n.º 7
0
        private void SetBrothers(ref OneNode node, string ColumnName)
        {
            int    mapid   = node.MapId;
            string mapName = "";

            if (htMapIDName.ContainsKey(mapid))
            {
                mapName = htMapIDName[mapid].ToString();
            }
            if (mapName == "")
            {
                return;
            }

            int       nTemplateId = GetTemplateId(QuestId, ColumnName);
            ArrayList arrBrothers = GetBrothers(mapName, nTemplateId, node.templateType);

            node.arrBrothers = arrBrothers;
        }
Exemplo n.º 8
0
        private void SetMoreInfo(ref OneNode node)
        {
            int       mapid  = node.MapId;
            MapConfig config = htMapConfig[mapid] as MapConfig;

            if (config == null)
            {
                node.imageMap = null;
                node.fScaleX  = 0.5f;
                node.fScaleY  = 0.5f;
                return;
            }
            int   cfgWidth  = 0;
            int   cfgHeight = 0;
            float cfgScale  = 0.0f;
            float cfgStartx = 0;
            float cfgStarty = 0;

            config.GetConfig(ref cfgWidth, ref cfgHeight, ref cfgStartx, ref cfgStarty, ref cfgScale);
            node.fScaleX  = (node.nX - cfgStartx) / (cfgWidth / cfgScale);
            node.fScaleY  = 1 - (node.nY - cfgStarty) / (cfgHeight / cfgScale);
            node.imageMap = config.TagImage;
        }
Exemplo n.º 9
0
        private void PaintNodeBrothers(OneNode node, Graphics g)
        {
            if (node == null ||
                node.nodeType == NodeType.POINT)
            {
                return;
            }
            ArrayList arrBrothers = node.arrBrothers;

            if (arrBrothers == null)
            {
                return;
            }
            float mydiameter = Diameter * 0.5f;

            foreach (object ob in arrBrothers)
            {
                MapLogicalFileReader.fPoint2d fpoint = (MapLogicalFileReader.fPoint2d)ob;
                float fx = fpoint.fX * CanvasWidth;
                float fy = fpoint.fY * canvasHeight;
                g.FillEllipse(Brushes.Purple, fx - mydiameter / 2, fy - mydiameter / 2, mydiameter, mydiameter);
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 开始和结束的节点
        /// </summary>
        /// <param name="columns"></param>
        /// <param name="row"></param>
        /// <param name="color"></param>
        /// <param name="treeColor"></param>
        private void AddPointNodes(string[] columns, DataRow row, Brush color, Color treeColor)
        {
            string ColumnName_MapID;
            string ColumnName_nX;
            string ColumnName_nY;

            int nValue_MapID;
            int nValue_nX;
            int nValue_nY;

            foreach (string columnkey in columns)
            {
                ColumnName_MapID = string.Format("{0}_MapId", columnkey);
                ColumnName_nX    = string.Format("{0}_nX", columnkey);
                ColumnName_nY    = string.Format("{0}_nY", columnkey);

                if (row.IsNull(ColumnName_MapID) || Convert.ToInt32(row[ColumnName_MapID]) == 0)
                {
                    continue;
                }
                nValue_MapID = row.IsNull(ColumnName_MapID) ? 0 : Convert.ToInt32(row[ColumnName_MapID]);
                nValue_nX    = row.IsNull(ColumnName_nX) ? 0 : Convert.ToInt32(row[ColumnName_nX]);
                nValue_nY    = row.IsNull(ColumnName_nY) ? 0 : Convert.ToInt32(row[ColumnName_nY]);

                OneNode nodeTag = new OneNode();
                nodeTag.Init(nValue_MapID, nValue_nX, nValue_nY, color);
                SetMoreInfo(ref nodeTag);

                DevComponents.AdvTree.Node newTreenode = new DevComponents.AdvTree.Node();
                newTreenode.Text  = htColumnNameDisplay[columnkey].ToString();
                newTreenode.Tag   = nodeTag;
                newTreenode.Style = new ElementStyle(); newTreenode.Style.TextColor = treeColor;

                nodeRoot.Nodes.Add(newTreenode);
                panelEx1.AddNode(nodeTag);
            }
        }
Exemplo n.º 11
0
        private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e)
        {
            DevComponents.AdvTree.Node advTreeNode = e.Node;
            if (advTreeNode == nodeRoot)
            {
                return;
            }

            OneNode nodeTag = advTreeNode.Tag as OneNode;          
            nodeCurrent = nodeTag;
            panelEx1.CurrentNode = nodeCurrent;

            UpdateStatus();
        }
Exemplo n.º 12
0
        private void SetBrothers(ref OneNode node, string ColumnName)
        {
            int mapid = node.MapId;
            string mapName = "";

            if (htMapIDName.ContainsKey(mapid))
            {
                mapName = htMapIDName[mapid].ToString();
            }
            if (mapName == "")
            {
                return;
            }

            int nTemplateId = GetTemplateId(QuestId, ColumnName);
            ArrayList arrBrothers = GetBrothers(mapName, nTemplateId, node.templateType);
            node.arrBrothers = arrBrothers;

           
        }
Exemplo n.º 13
0
 private void SetMoreInfo(ref OneNode node)
 {
     int mapid = node.MapId;
     MapConfig config = htMapConfig[mapid] as MapConfig;
     if (config == null)
     {
         node.imageMap = null;
         node.fScaleX = 0.5f;
         node.fScaleY = 0.5f;
         return;
     }
     int cfgWidth = 0;
     int cfgHeight = 0;
     float cfgScale = 0.0f;
     float cfgStartx = 0;
     float cfgStarty = 0;
     config.GetConfig(ref cfgWidth, ref cfgHeight, ref cfgStartx, ref cfgStarty, ref cfgScale);
     node.fScaleX = (node.nX - cfgStartx) / (cfgWidth / cfgScale);
     node.fScaleY = 1 - (node.nY - cfgStarty) / (cfgHeight / cfgScale);
     node.imageMap = config.TagImage;
 }
Exemplo n.º 14
0
        /// <summary>
        /// 开始和结束的节点
        /// </summary>
        /// <param name="columns"></param>
        /// <param name="row"></param>
        /// <param name="color"></param>
        /// <param name="treeColor"></param>
        private void AddPointNodes(string[] columns, DataRow row, Brush color, Color treeColor)
        {
            string ColumnName_MapID;
            string ColumnName_nX;
            string ColumnName_nY;

            int nValue_MapID;
            int nValue_nX;
            int nValue_nY;

            foreach (string columnkey in columns)
            {
                ColumnName_MapID = string.Format("{0}_MapId", columnkey);
                ColumnName_nX = string.Format("{0}_nX", columnkey);
                ColumnName_nY = string.Format("{0}_nY", columnkey);

                if (row.IsNull(ColumnName_MapID) || Convert.ToInt32(row[ColumnName_MapID]) == 0)
                {
                    continue;
                }
                nValue_MapID = row.IsNull(ColumnName_MapID) ? 0 : Convert.ToInt32(row[ColumnName_MapID]);
                nValue_nX = row.IsNull(ColumnName_nX) ? 0 : Convert.ToInt32(row[ColumnName_nX]);
                nValue_nY = row.IsNull(ColumnName_nY) ? 0 : Convert.ToInt32(row[ColumnName_nY]);

                OneNode nodeTag = new OneNode();
                nodeTag.Init(nValue_MapID, nValue_nX, nValue_nY, color);
                SetMoreInfo(ref nodeTag);

                DevComponents.AdvTree.Node newTreenode = new DevComponents.AdvTree.Node();
                newTreenode.Text = htColumnNameDisplay[columnkey].ToString();
                newTreenode.Tag = nodeTag;
                newTreenode.Style = new ElementStyle(); newTreenode.Style.TextColor = treeColor;

                nodeRoot.Nodes.Add(newTreenode);
                panelEx1.AddNode(nodeTag);
            }
              

        }
Exemplo n.º 15
0
        private void AddRegionNodes(string[] columns, DataRow row, Color treeColor, bool needEdit, TemplateType ttype)
        {
            string ColumnName_MapID; 
            string ColumnName_Areas;

            int nValue_MapID;
            string strValue_Areas;
           
            foreach (string columnkey in columns)
            {
                ColumnName_MapID = string.Format("{0}_MapId", columnkey);
                ColumnName_Areas = string.Format("{0}_Areas", columnkey);

                if (!needEdit && 
                    (row.IsNull(ColumnName_MapID) || Convert.ToInt32(row[ColumnName_MapID]) == 0)
                    )
                {
                    continue;
                }
                nValue_MapID = row.IsNull(ColumnName_MapID) ? 0 : Convert.ToInt32(row[ColumnName_MapID]);
                strValue_Areas = row.IsNull(ColumnName_Areas) ? "" : row[ColumnName_Areas].ToString();

                if (nValue_MapID == 0)
                {
                    nValue_MapID = DefaultMapId;
                }

                OneNode nodeTag = new OneNode();
                nodeTag.Init(nValue_MapID, strValue_Areas, ttype, columnkey);
                nodeTag.CanEdit = needEdit;
                SetBrothers(ref nodeTag, columnkey);
                MapConfig config = htMapConfig[nValue_MapID] as MapConfig;
                if (config != null)
                {
                    nodeTag.imageMap = config.TagImage;
                }
                DevComponents.AdvTree.Node newTreenode = new DevComponents.AdvTree.Node();
                newTreenode.Text = htColumnNameDisplay[columnkey].ToString();
                newTreenode.Tag = nodeTag;
                newTreenode.Style = new ElementStyle(); newTreenode.Style.TextColor = treeColor;

                nodeRoot.Nodes.Add(newTreenode);
                ArryNodes.Add(nodeTag);
            }


        }
Exemplo n.º 16
0
        private void PaintNodeBrothers(OneNode node, Graphics g)
        {
            if (node == null ||
                node.nodeType == NodeType.POINT)
            {
                return;
            }
            ArrayList arrBrothers = node.arrBrothers;
            if (arrBrothers == null)
            {
                return;
            }
            float mydiameter = Diameter * 0.5f;

            foreach (object ob in arrBrothers)
            {
                MapLogicalFileReader.fPoint2d fpoint = (MapLogicalFileReader.fPoint2d)ob;
                float fx = fpoint.fX * CanvasWidth;
                float fy = fpoint.fY * canvasHeight;
                g.FillEllipse(Brushes.Purple, fx - mydiameter / 2, fy - mydiameter / 2, mydiameter, mydiameter);               
            }

        }
Exemplo n.º 17
0
 public void ClearNodes()
 {
     ArryQuestNode.Clear();
     CurrentNode = null;
 }
Exemplo n.º 18
0
 public void AddNode(OneNode node)
 {
     if (node != null)
     {
         ArryQuestNode.Add(node);
     }
 }       
Exemplo n.º 19
0
 public void ClearNodes()
 {
     ArryQuestNode.Clear();
     CurrentNode = null;
 }
Exemplo n.º 20
0
        private void SaveOneNode(OneNode node)
        {
            if (node.IsChanged)
            {   
                string strKey = node.ColumnNameKey;
                string ColumnName_nMapId = string.Format("{0}_MapId", strKey);
                string ColumnName_Areas = string.Format("{0}_Areas", strKey);

                string sql = string.Format( 
                    " update {0} set {1} = {2}, {3} = '{4}' where QuestId ={5}",
                    QuestGuideTableName, ColumnName_nMapId, node.MapId, ColumnName_Areas, node.StringGrayIds, QuestId
                    );
                Helper.SqlNoneQureyExcute(Conn, sql);
                node.BackUp();
            }
        }
Exemplo n.º 21
0
        public bool reloadAll(string keyword)
        {
            if (!bHasInitHashTable)
            {
                InitHashtable();
                bHasInitHashTable = true;
            }

            panelEx1.ClearPaint();           

            string[] keywords = keyword.Split(new char[] {','});
            if (keywords.Length != 2)
                MessageBox.Show("错误的reloadAll参数");

            int questid = Convert.ToInt32(keywords[1]);
            if (questid < 0)
            {
                return false;
            }
            QuestId = questid;
            nodeRoot.Text = GetQuestName(questid);            
            reloadNodes(questid);           
            nodeCurrent = nodeRoot.Nodes[0].Tag as OneNode;
            UpdateStatus();
            dgvQuestInfo.DataSource = GetQuestMoreInfo();
            
            return true;
        }
Exemplo n.º 22
0
 public void ClearPaint()
 {
     ColorClear();
     this.ArryQuestNode.Clear();
     this.CurrentNode = null;            
     this.Refresh();
 }