Пример #1
0
        private void renewTreeView()
        {
            treeView.Nodes.Clear();
            AccessSqlite sql = new AccessSqlite();
            int          point;

            string[] rows = sql.getRows(project, "class", "name = '" + path + "'");
            int      i    = 0;

            try
            {
                if (rows == null || rows[0] == "")
                {
                    return;
                }
                while (rows.Length > i)
                {
                    treeView.Nodes.Add(rows[i]);
                    treeView.Nodes[i].BackColor = Color.DarkViolet;
                    treeView.Nodes[i].ForeColor = Color.White;
                    string[] row = sql.getRows(project, "field", "name = '" + path + "' and class = '" + rows[i] + "'");
                    if (row != null && row[0] != "" && row[0] != null)
                    {
                        point = row[0].IndexOf(",");
                        while (point != -1)
                        {
                            string temp   = row[0].Substring(0, point);
                            int    point2 = temp.IndexOf("-");
                            temp = temp.Substring(0, point2) + "(" + temp.Substring(point2 + 1) + ")";
                            treeView.Nodes[i].Nodes.Add(temp);
                            row[0] = row[0].Substring(point + 1);
                            point  = row[0].IndexOf(",");
                        }
                    }
                    i++;
                }
            }
            catch (Exception e)
            {
            }
        }
Пример #2
0
        private void resetList()
        {
            projectList.Items.Clear();
            AccessSqlite sql = new AccessSqlite();

            string[] rows = sql.getRows("sqlite_master", "name", "type = 'table'");
            if (rows == null)
            {
                return;
            }
            int i = 0;

            while (rows.Length > i)
            {
                projectList.Items.Add(rows[i]);
                i++;
            }
        }
Пример #3
0
        private void setDirectory()
        {
            AccessSqlite sql = new AccessSqlite();
            ManageFile   mf  = new ManageFile();

            string[] rows = sql.getRows(projectName, "name", null);
            int      i    = 0;

            try
            {
                while (rows.Length > i)
                {
                    string row = rows[i].Replace(".", @"\");
                    mf.createDirectory(projectName + @"\" + row);
                    i++;
                }
            }
            catch (Exception e)
            {
            }
        }
Пример #4
0
        private void renewTreeView()
        {
            treeView.Nodes.Clear();
            AccessSqlite sql = new AccessSqlite();

            string[] rows = sql.getRows(project, "name", null);
            int      i    = 0;

            if (rows == null)
            {
                return;
            }
            while (rows.Length > i)
            {
                if (nodeList == null)
                {
                    nodeList = new Node(rows[i]);
                }
                else
                {
                    addNode(rows[i]);
                }
                int point = rows[i].LastIndexOf(".");
                while (point != -1)
                {
                    rows[i] = rows[i].Substring(0, point);
                    addNode(rows[i]);
                    point = rows[i].LastIndexOf(".");
                }
                i++;
            }

            tempNode = nodeList;
            while (tempNode != null)
            {
                string pPath = tempNode.getPath();
                int    point = pPath.LastIndexOf(".");
                if (point != -1)
                {
                    pPath = pPath.Substring(0, point);
                }
                else
                {
                    pPath = "";
                }
                Node tempNode2 = nodeList;
                while (tempNode2 != null)
                {
                    if (string.Compare(tempNode2.getPath(), pPath) == 0)
                    {
                        tempNode2.getNode().Nodes.Add(tempNode.getNode());
                        break;
                    }
                    tempNode2 = tempNode2.getNext();
                }
                tempNode = tempNode.getNext();
            }

            tempNode = nodeList;
            while (tempNode != null)
            {
                if (string.Compare(tempNode.getNode().Text, tempNode.getPath()) == 0)
                {
                    treeView.Nodes.Add(tempNode.getNode());
                }
                tempNode = tempNode.getNext();
            }
        }
Пример #5
0
        private void setClassFile()
        {
            AccessSqlite sql = new AccessSqlite();
            ManageFile   mf  = new ManageFile();
            string       path;
            int          point;

            string[] rows = sql.getRowsDistinct(projectName, "name", null);
            int      i    = 0;
            int      j    = 0;

            try
            {
                while (rows.Length > i)
                {
                    path = rows[i].Replace(".", @"\");
                    string[] crows = sql.getRows(projectName, "class", "name = '" + rows[i] + "'");
                    j = 0;
                    try
                    {
                        while (crows.Length > j)
                        {
                            if (crows[j] == "")
                            {
                                j++;
                                continue;
                            }
                            if (mf.checkFile(path, crows[j]))
                            {
                                // field check
                                j++;
                                continue;
                            }
                            string curDir;
                            point = rows[i].LastIndexOf(".");
                            if (point != -1)
                            {
                                curDir = rows[i].Substring(point + 1);
                            }
                            else
                            {
                                curDir = rows[i];
                            }
                            int result = mf.createFile(projectName + @"\" + path, curDir, crows[j]);
                            if (result == 0)
                            {
                                try
                                {
                                    string[] frow = sql.getRows(projectName, "field", "name = '" + rows[i] + "' and class = '" + crows[j] + "'");
                                    if (frow[0] == "")
                                    {
                                        j++;
                                        continue;
                                    }
                                    mf.createField(projectName + @"\" + path, curDir, crows[j], frow[0]);
                                }
                                catch (Exception e)
                                {
                                }
                            }
                            j++;
                        }
                    }
                    catch (Exception e)
                    {
                    }
                    i++;
                }
            }
            catch (Exception e)
            {
            }
        }