示例#1
0
        private void LoadBtn_Click(object sender, EventArgs e)
        {
            if (loadthread != null)
            {
                return;
            }

            var           name = (string)TextureList.SelectedItem;
            IFileProvider prov;

            if (Directory.Exists(Path.Combine(ImgPath, name)))
            {
                prov = new DirProvider(new DirectoryInfo(Path.Combine(ImgPath, name)));
            }
            else if (File.Exists(Path.Combine(ImgPath, name + ".zip")))
            {
                prov = new ZipProvider(new FileStream(Path.Combine(ImgPath, name + ".zip"), FileMode.Open, FileAccess.Read));
            }
            else
            {
                SetText("Not found");
                return;
            }

            loadthread = new Thread(loadfunc);
            loadthread.Start(prov);
        }
示例#2
0
        private void LoadBtn_Click(object sender, EventArgs e)
        {
            if (loadthread != null)
                return;

            var name = (string)TextureList.SelectedItem;
            IFileProvider prov;
            if (Directory.Exists(Path.Combine(ImgPath, name)))
            {
                prov = new DirProvider(new DirectoryInfo(Path.Combine(ImgPath, name)));
            }
            else if (File.Exists(Path.Combine(ImgPath, name + ".zip")))
            {
                prov = new ZipProvider(new FileStream(Path.Combine(ImgPath, name + ".zip"), FileMode.Open, FileAccess.Read));
            }
            else
            {
                SetText("Not found");
                return;
            }

            loadthread = new Thread(loadfunc);
            loadthread.Start(prov);
        }