Пример #1
0
        private void Button3_Click(object sender, EventArgs e)
        {
            Label3.Visible = true;
            Label4.Font    = new Font("Segoe UI", 14.25f);
            Button5.Font   = new Font("Segoe UI", 18);
            Button2.Text   = "Browse";
            Button5.Text   = "Open folder";
            Button1.Text   = "Start";
            lang           = "en";
            FileSystem.WriteAllText(appPath + "/lang.set", "lang=EN_US", false);

            Label9.Text = "I/O Error";
            Label9.Font = new Font("Segoe UI", 12.5f, FontStyle.Regular);
            Label6.Text = "Duplicated file";
            Label6.Font = new Font("Segoe UI", 10.3f, FontStyle.Regular);

            Label2.Font = new Font("Segoe UI", 12, FontStyle.Regular);
            Label2.Text = "Progress: ";

            Label3.Visible = false;
            Label4.Text    = "Wait";

            Label13.Text = "An update available.";
            Button7.Text = "Update";
        }
Пример #2
0
        private void Button4_Click(object sender, EventArgs e)
        {
            Label3.Visible = true;
            Label4.Font    = new Font("맑은 고딕", 14.25f);
            Button5.Font   = new Font("맑은 고딕", 18);
            Button2.Text   = "찾아보기";
            Button1.Text   = "시작";

            Button5.Text = "폴더 열기";
            lang         = "ko";
            FileSystem.WriteAllText(appPath + "/lang.set", "lang=KO_KR", false);

            Label9.Text = "I/O 오류";
            Label9.Font = new Font("맑은 고딕", 8.5f, FontStyle.Regular);
            Label6.Text = "파일 중복";
            Label9.Font = new Font("맑은 고딕", 8, FontStyle.Regular);

            Label2.Font = new Font("맑은 고딕", 12, FontStyle.Regular);
            Label2.Text = "진행률: ";

            Label3.Visible = false;
            Label4.Text    = "대기";

            Label13.Text = "업데이트가 존재합니다.";
            Button7.Text = "업데이트";
        }
Пример #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Show();

            if (System.Globalization.CultureInfo.CurrentCulture.TwoLetterISOLanguageName != "ko")
            {
                Button3.Visible = false;
                Button4.Visible = false;
            }
            int a = Screen.PrimaryScreen.Bounds.Width / 2;
            int b = Screen.PrimaryScreen.Bounds.Height / 2;

            this.Top  = b - this.Height / 2;
            this.Left = a - this.Width / 2;
            OpenFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/.minecraft/assets/indexes";
            // 설정파일 처음 세팅
            appPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "/indexextract";
            if (!FileSystem.FileExists(appPath + "/lang.set"))
            {
                FileSystem.CreateDirectory(appPath);
                FileSystem.WriteAllText(appPath + "/lang.set", "lang=EN_US", false);
            }
            //설정 파일 불러오기
            string se   = FileSystem.ReadAllText(appPath + "/lang.set");
            string lang = "";

            try {
                lang = Strings.Split(se, "lang=")[1];
            } catch (IndexOutOfRangeException) {
                //todo button 3 click
            }
            if (lang == "EN_US")
            {
                Button3_Click(sender, e);
            }
            else if (lang == "KO_KR")
            {
                Button4_Click(sender, e);
            }
            else
            {
                FileSystem.DeleteFile(appPath + "/lang.set");
                Application.Restart();
            }
            this.MaximizeBox = false;

            Thread t = new Thread(AsyncUpCheck);

            t.Priority = ThreadPriority.Lowest;
            t.Start();

            if (lang == "ko")
            {
                Label4.Text = "대기";
            }
            else if (lang == "en")
            {
                Label4.Text = "Wait";
            }
        }
Пример #4
0
        private void Button1_Click(object sender, EventArgs e)
        {
            if (lang == "ko")
            {
                Label4.Text = "준비 중";
            }
            else if (lang == "en")
            {
                Label4.Text = "Preparing";
            }

            BrowserResult br = new BrowserResult();

            try {
                br = Form2.GetResult();
            } catch (NullReferenceException) {
                MessageBox.Show("ERR_FILE_NOT_SELECTED", "Indexextract", MessageBoxButtons.OK);
                return;
            }
            abcd               = Strings.Split(br.file, "\\").Length - 1;
            Label7.Text        = "0";
            Label8.Text        = "0";
            ProgressBar1.Value = 0;
            i               = 0;
            index           = 3;
            ale             = 0;
            ncp             = 0;
            Label4.Visible  = true;
            Label3.Visible  = true;
            Label1.Visible  = true;
            Button2.Enabled = false;
            Button1.Enabled = false;
            Button5.Enabled = false;
            if (lang == "ko")
            {
                Label4.Text = "작업 중";
            }
            else if (lang == "en")
            {
                Label4.Text = "Working";
            }

            string fullt = FileSystem.ReadAllText(br.file);

            b           = Strings.Split(fullt, "hash").Length - 1;
            WorkDataObj = new WorkData()
            {
                dataJson   = Strings.Split(fullt, "\""),
                targetPath = $"{Application.StartupPath}\\indexextract\\{Strings.Split(Strings.Split(br.file, "\\")[abcd], ".json")[0]}"
            };

            Thread t = new Thread(WorkThread);

            t.Name     = "Indexextract worker";
            t.Priority = ThreadPriority.Highest;
            t.Start();
        }
Пример #5
0
        private void tsmiPasteFolder_Click(object sender, EventArgs e)
        {
            try
            {
                string selectedNodePath = tvProject.SelectedNode.Tag.ToString();
                string copiedNodePath   = Clipboard.GetData(DataFormats.Text).ToString();

                if (Directory.Exists(copiedNodePath))
                {
                    DirectoryInfo copiedNodeDirectoryInfo = new DirectoryInfo(copiedNodePath);

                    if (Directory.Exists(Path.Combine(selectedNodePath, copiedNodeDirectoryInfo.Name)))
                    {
                        throw new Exception("A directory with this name already exists in this location");
                    }

                    else if (copiedNodePath == _scriptProjectPath)
                    {
                        throw new Exception("The project directory cannot be copied or moved");
                    }

                    else
                    {
                        VBFileSystem.CopyDirectory(copiedNodePath, Path.Combine(selectedNodePath, copiedNodeDirectoryInfo.Name));
                        NewNode(tvProject.SelectedNode, copiedNodePath, "folder");
                    }
                }
                else if (File.Exists(copiedNodePath))
                {
                    FileInfo copiedNodeFileInfo = new FileInfo(copiedNodePath);

                    if (File.Exists(Path.Combine(selectedNodePath, copiedNodeFileInfo.Name)))
                    {
                        throw new Exception("A file with this name already exists in this location");
                    }

                    else if (copiedNodeFileInfo.Name == _mainFileName || copiedNodeFileInfo.Name == "project.config")
                    {
                        throw new Exception("This file cannot be copied or moved");
                    }

                    else
                    {
                        File.Copy(copiedNodePath, Path.Combine(selectedNodePath, copiedNodeFileInfo.Name));
                        NewNode(tvProject.SelectedNode, copiedNodePath, "file");
                    }
                }
                else
                {
                    throw new Exception("Attempted to paste something that isn't a file or folder");
                }
            }
            catch (Exception ex)
            {
                Notify("An Error Occured: " + ex.Message);
            }
        }
Пример #6
0
 public void Fds()
 {
     ComboBox1.Items.Clear();
     foreach (string foundFile in FileSystem.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\.minecraft\\assets\\indexes"))
     {
         string[] its = Strings.Split(foundFile, "\\");
         string   it  = its[its.Length - 1];
         ComboBox1.Items.Add(it);
     }
 }
Пример #7
0
        private void WorkThread()
        {
            VoidDelegate vd = new VoidDelegate(RefreshIndexTexts);
            ControlStrD  cd = new ControlStrD(SetControlIntTxt);

            while (true)
            {
                for (int t = 1; t <= 50; t++)
                {
                    i++;
                    string file;
                    string hash;
                    try {
                        file   = WorkDataObj.dataJson[index];
                        hash   = WorkDataObj.dataJson[index + 4];
                        index += 8;
                    } catch (IndexOutOfRangeException) {
                        Invoke(vd);
                        VoidDelegate ed = new VoidDelegate(WorkEnd);
                        Invoke(ed);
                        return;
                    }
                    string sourceFile = ad + "assets\\objects\\" + Strings.Left(hash, 2) + "\\" + hash;
                    string targetFile = WorkDataObj.targetPath + "\\" + file;
                    if (FileSystem.FileExists(targetFile))
                    {
                        ale++;
                        Invoke(cd, new ControlStr(Label7, ale.ToString()));
                        continue;
                    }
                    try {
                        FileSystem.CopyFile(sourceFile, targetFile);
                    } catch (FileNotFoundException) {
                        ncp++;
                        Invoke(cd, new ControlStr(Label8, ncp.ToString()));
                    }
                }
                Invoke(vd);
            }
        }
Пример #8
0
        private void _CargarArchivosRelacionados()
        {
            FileInfo InfoArchivo;

            dgvArchivos.Rows.Clear();

            // Recorremos unicamente aquellos archivos que tengan una extensión que esté entre las permitidas por la aplicación.
            foreach (
                string WNombreArchivo in
                Directory.GetFiles(WPath)
                .Where(s => EXTENSIONES_PERMITIDAS.Contains(Path.GetExtension(s).ToLower())))
            {
                InfoArchivo = FileSystem.GetFileInfo(WNombreArchivo);

                {
                    FileInfo withBlock = InfoArchivo;
                    string   Ext       = withBlock.Extension;
                    dgvArchivos.Rows.Add(withBlock.CreationTime.ToString("dd/MM/yyyy"), Strings.UCase(withBlock.Name),
                                         _ObtenerIconoSegunTipoArchivo(Ext), withBlock.FullName);
                }
            }
        }