コード例 #1
0
        Spectr GetSpectr(int index)
        {
            string[] names = Folder.GetRecordList("ss");
            if (index > names.Length || index < 0)
            {
                return(null);
            }
            Spectr sp = new Spectr(Folder, names[index]);

            return(sp);
        }
コード例 #2
0
        void LoadList()
        {
            cbKnownConditions.SelectedIndex = -1;
            cbKnownConditions.Items.Clear();
            DbFolder fld = Common.Db.GetFolder(Common.DbNameSystemFolder);

            string[] list = fld.GetRecordList("ssc");
            for (int i = 0; i < list.Length; i++)
            {
                string tmp = list[i].Substring(0, list[i].Length - 4);
                cbKnownConditions.Items.Add(tmp);
            }
        }
コード例 #3
0
        }//*/

        void UpdateNodeList(TreeNodeCollection nodes, DbFolder folder)
        {
            string[] fnames = folder.GetFolderList();
            for (int i = 0; i < fnames.Length; i++)
            {
                TreeNode cur_node = null;
                for (int j = 0; j < nodes.Count; j++)
                {
                    if (((CSTreeNodeTag)nodes[j].Tag).SpName == null && nodes[j].Text.Equals(fnames[i]))
                    {
                        cur_node = nodes[i];
                        break;
                    }
                }
                if (cur_node == null)
                {
                    cur_node = nodes.Add(fnames[i]);
                }
                cur_node.Tag = new CSTreeNodeTag(new DbFolder(fnames[i], folder), null);
                cur_node.SelectedImageIndex = 1;
                cur_node.StateImageIndex    = 0;
                UpdateNodeList(cur_node.Nodes, new DbFolder(fnames[i], folder));
            }

            string[] names = folder.GetRecordList("ss", true);
            //for (int i = 0; i < names.Length; i++)
            //    names[i] = names[i].Substring(0, names[i].Length - 3);
            for (int i = 0; i < names.Length; i++)
            {
                bool found = false;
                for (int j = 0; j < nodes.Count; j++)
                {
                    if (((CSTreeNodeTag)nodes[j].Tag).SpName != null && nodes[j].Text.Equals(names[i]))
                    {
                        found = true;
                        break;
                    }
                }
                if (found == false)
                {
                    TreeNode nd = nodes.Add(names[i]);
                    nd.Tag = new CSTreeNodeTag(folder, names[i]);
                    nd.SelectedImageIndex = 3;
                    nd.ImageIndex         = 2;
                }
            }

            for (int i = 0; i < nodes.Count; i++)
            {
                bool found = false;
                for (int j = 0; j < fnames.Length; j++)
                {
                    if (fnames[j].Equals(nodes[i].Text) == true)
                    {
                        found = true;
                        break;
                    }
                }
                for (int j = 0; found == false && j < names.Length; j++)
                {
                    if (names[j].Equals(nodes[i].Text) == true)
                    {
                        found = true;
                        break;
                    }
                }
                if (found == false)
                {
                    nodes.RemoveAt(i);
                    i--;
                }
            }
        }