Пример #1
0
        public void RefreshFiles()
        {
            dic.Clear();
            RJFile f;

            foreach (FileInfo info in Utils.ScanFiles())
            {
                f = new RJFile(info);

                foreach (String rj in f.RJ.Split(new String[] { "," }, StringSplitOptions.RemoveEmptyEntries))
                {
                    if (!dic.ContainsKey(rj))
                    {
                        dic.Add(rj, new List <RJFile>());
                        imageList.Images.Add(rj, HTMLHelper.GetRJImage(rj));
                    }
                    dic[rj].Add(f);
                }
            }
            listView1.LargeImageList = imageList;

            RefreshViewer();
        }
Пример #2
0
        public void RefreshFiles()
        {
            listBox1.Items.Clear();
            //rjf.Clear();
            int i = 0;

            foreach (String folder in FolderManager.loadList())
            {
                DirectoryInfo info = new DirectoryInfo(folder);
                if (info.Exists)
                {
                    listBox1.Items.Add(new ListInfo("-----------------------------", -1, null));
                    listBox1.Items.Add(new ListInfo(folder, -2, null));
                    listBox1.Items.Add(new ListInfo("-----------------------------", -1, null));
                    RJFile c;

                    foreach (FileInfo f in info.GetFiles())
                    {
                        c = new RJFile(f);
                        ListInfo info1 = new ListInfo(f.Name, i, c);
                        listBox1.Items.Add(info1);
                    }
                }
            }

            if (co != null)
            {
                co.Clear();
            }

            foreach (Object o in listBox1.Items)
            {
                co.Add(o);
            }

            filter();
        }
Пример #3
0
 public ListInfo(String name, int num, RJFile file)
 {
     this.name = name;
     this.num  = num;
     this.file = file;
 }
Пример #4
0
        public void finding(Object pack)
        {
            Object        sender = ((ListPack)pack).sender;
            List <Object> co     = ((ListPack)pack).co;

            Dictionary <String, List <RJFile> > x = new Dictionary <string, List <RJFile> >();

            foreach (Object o in co)
            {
                RJFile   c   = (o as ContentPage.ListInfo).File;
                String[] rjs = c.RJ.Split(',');
                foreach (String xx in rjs)
                {
                    if (xx == "?")
                    {
                        continue;
                    }
                    if (x.ContainsKey(xx))
                    {
                        x[xx].Add(c);
                    }
                    else
                    {
                        x.Add(xx, new List <RJFile>());
                        x[xx].Add(c);
                    }
                }
            }
            bool a = false;

            foreach (KeyValuePair <String, List <RJFile> > k in x)
            {
                if (k.Value.Count > 1)
                {
                    foreach (RJFile d in k.Value)
                    {
                        FileInfo info = new FileInfo(d.fullPath);
                        if (!info.Exists)
                        {
                            continue;
                        }
                        ListViewItem item = new ListViewItem();
                        item.Text = info.Name;
                        item.SubItems.Add(k.Key);
                        item.SubItems.Add(Utils.FileSize(info.Length));
                        item.SubItems.Add(d.RJ);
                        item.SubItems.Add(d.fullPath);
                        item.BackColor = a ? Color.FromArgb(0xE9E6FF) : Color.White;

                        this.Invoke((EventHandler)
                                    (delegate
                        {
                            if (!(sender as ListView).IsHandleCreated)
                            {
                                return;
                            }
                            (sender as ListView).Items.Add(item);
                        })
                                    );
                    }
                    a = !a;
                }
            }
        }