Beispiel #1
0
        private async void OnStartSearchCommandsExcuted(object obj)
        {
            await Task.Run(() =>
            {
                try
                {
                    DetailsInfo.Clear();
                    FileContentMatchEngine.Instance.MatchesCount = 0;
                    SkinAssistanceCommands.StartRealTimerCommand.ExcuteCommand(true);
                    var options  = FileMatcheOptions.Where(o => o.IsSelected);
                    var fileList = Directory.GetFiles(FindDir, "*.cs", SearchOption.AllDirectories);
                    SkinAssistanceCommands.ShowInformationCommand.ExcuteCommand <string>($"Analyze Start");

                    foreach (var file in fileList)
                    {
                        SkinAssistanceCommands.ShowInformationCommand.ExcuteCommand <string>($"analyze {file} start");
                        FileContentMatchEngine.Instance.Match(file, options, matchoption);
                        SkinAssistanceCommands.ShowInformationCommand.ExcuteCommand <string>($"analyze {file} end");
                    }

                    SkinAssistanceCommands.StartRealTimerCommand.ExcuteCommand(false);
                    SkinAssistanceCommands.ShowInformationCommand.ExcuteCommand <string>($"Analyze End");
                }
                catch (Exception e)
                {
                    this.Error(e);
                }
            });
        }
        private async void OnStartSearchCommandsExcuted(object obj)
        {
            await Task.Run(() =>
            {
                try
                {
                    ResourceManager.Default.Initialize(AppName);
                    matchoption.ResourceCulture = UICultrues.Where(o => o.IsSelected).Select(o => o.MatchName).ToList();
                    DetailsInfo.Clear();
                    FileContentMatchEngine.Instance.MatchesCount = 0;
                    if (matchoption.ResourceCulture.Any())
                    {
                        SkinAssistanceCommands.StartRealTimerCommand.ExcuteCommand(true);
                        var options  = FileMatcheOptions.Where(o => o.IsSelected);
                        var fileList = Directory.GetFiles(FindDir, "*.cs", SearchOption.AllDirectories);
                        SkinAssistanceCommands.ShowInformationCommand.ExcuteCommand <string>($"Analyze Start");

                        foreach (var file in fileList)
                        {
                            SkinAssistanceCommands.ShowInformationCommand.ExcuteCommand <string>($"analyze {file} start");
                            FileContentMatchEngine.Instance.Match(file, options, matchoption);
                            SkinAssistanceCommands.ShowInformationCommand.ExcuteCommand <string>($"analyze {file} end");
                        }
                        matchoption.ResourceCulture.ForEach(o =>
                        {
                            SkinAssistanceCommands.ShowDetailsInformationCommand.ExcuteCommand <string>($"build resource {o} start");
                            ResourceManager.Default.SaveAs(CultureInfo.GetCultureInfo(o));
                            SkinAssistanceCommands.ShowDetailsInformationCommand.ExcuteCommand <string>($"build resource {o} end");
                        });
                        SkinAssistanceCommands.StartRealTimerCommand.ExcuteCommand(false);
                        SkinAssistanceCommands.ShowInformationCommand.ExcuteCommand <string>($"Analyze End");
                    }
                }
                catch (Exception e)
                {
                    this.Error(e);
                }
            });
        }
 private bool OnStartSearchCommandsCanExcuted(object arg)
 {
     return(!string.IsNullOrEmpty(FindDir.ToSafeString()) && FileMatcheOptions.Any(o => o.IsSelected));
 }