コード例 #1
0
        public async void LoadBtx()
        {
            string args = SelectedPath.Value;

            Btx = await Task.Run(() => NDSImageFactory.LoadBtx(args));

            if (Btx.Errors.Count > 0)
            {
                MessageBox.Show(string.Join("\r\n", Btx.Errors));
                Btx = null;
            }
        }
コード例 #2
0
        private void BtxBatchImport(string[] pngsDirectory)
        {
            foreach (var path in pngsDirectory)
            {
                string arg;
                string btxName = $"{path.Split('\\').Last()}.btx";
                FilePaths.List.TryGetValue(btxName, out arg);
                if (arg != null)
                {
                    Btx tmp = null; //= new Btx(arg);

                    if (tmp.Errors.Count == 0)
                    {
                        tmp.ImportMultipleTextures(Directory.GetFiles(path));
                        if (tmp.Errors.Count == 0)
                        {
                            tmp.SaveToFile();
                        }
                        else
                        {
                            ErrorsLog.AddRange(tmp.Errors);
                        }
                    }
                    else
                    {
                        ErrorsLog.AddRange(tmp.Errors);
                    }
                }
                else
                {
                    ErrorsLog.AddRange(Btx.Errors);
                }
            }

            if (ErrorsLog.Count == 0)
            {
                _ = MessageBox.Show($"Imagens importadas com sucesso.");
            }
            else
            {
                _ = MessageBox.Show($"{string.Join("\r\n", ErrorsLog)}");
                ErrorsLog.Clear();
            }
        }