Exemplo n.º 1
0
Arquivo: Util.cs Projeto: sdjnyty/amt
        public static IEnumerable <string> EnumerateHkiFiles()
        {
            var folders = Directory.GetDirectories(ProgramModel.MakeHawkempirePath("Games"))
                          .Concat(new[] { ProgramModel.MakeHawkempirePath(string.Empty) });

            return(folders.SelectMany(f => Directory.GetFiles(f, "*.hki", SearchOption.TopDirectoryOnly)));
        }
Exemplo n.º 2
0
 private async void wnd_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         await ProgramModel.UpdateResources();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 3
0
 public void Execute(object parameter)
 {
     try
     {
         File.Copy(ProgramModel.MakeExeRelativePath(@"dll\ini\language_empty.dll"), ProgramModel.MakeExeRelativePath(@"dll\ini\language.dll"), true);
         File.Copy(ProgramModel.MakeExeRelativePath(@"dll\ini\language_empty.dll"), ProgramModel.MakeExeRelativePath(@"dll\ini\language_x1.dll"), true);
         File.Copy(ProgramModel.MakeExeRelativePath(@"dll\ini\language_empty.dll"), ProgramModel.MakeExeRelativePath(@"dll\ini\language_x1_p1.dll"), true);
         var count = Model.Util.ParseIniToDll(ProgramModel.MakeExeRelativePath(@"dll\ini\language.dll.ini"),
                                              ProgramModel.MakeExeRelativePath(@"dll\ini\language.dll"));
         MessageBox.Show($"生成完成!共写入 {count} 条字符串。");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 4
0
            public void Execute(object parameter)
            {
                var isC = "c".Equals((string)parameter, StringComparison.InvariantCultureIgnoreCase);

                if (MessageBox.Show("本按钮会将所有玩家的快捷键设置为 " + (isC ? "C" : "AoFE") + " 版默认键位,确认继续?", string.Empty, MessageBoxButton.OKCancel, MessageBoxImage.Question) == MessageBoxResult.OK)
                {
                    var hkiSrc = ProgramModel.MakeExeRelativePath(@"hki\" + (isC ? "c" : "fe") + ".hki");
                    foreach (var hkiDest in Util.EnumerateHkiFiles())
                    {
                        try
                        {
                            File.Copy(hkiSrc, hkiDest, true);
                        }
                        catch (IOException ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                }
            }
Exemplo n.º 5
0
            public void Execute(object parameter)
            {
                var paras = ((string)parameter).Split(':');
                var hawk  = paras[0].Equals("hawk", StringComparison.InvariantCultureIgnoreCase);
                var path  = paras[1];

                try
                {
                    var exePath = hawk ? ProgramModel.MakeHawkempirePath(path) : ProgramModel.MakeExeRelativePath(path);
                    Process.Start(new ProcessStartInfo(exePath)
                    {
                        WorkingDirectory = Path.GetDirectoryName(exePath),
                        UseShellExecute  = true,
                    });
                }
                catch (Win32Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
Exemplo n.º 6
0
 private async void Window_Loaded(object sender, RoutedEventArgs e)
 {
     await ProgramModel.StartUpdate();
 }
Exemplo n.º 7
0
 public async void Execute(object parameter)
 {
     await ProgramModel.StartUpdate();
 }