コード例 #1
0
        public TestLogViewModel(ArtifactsViewModel model)
        {
            this.model = model;

            Tests  = GetTests(model.WorkerLog);
            Passed = Tests.All(x => x.Passed);
        }
コード例 #2
0
ファイル: TestLogViewModel.cs プロジェクト: Xarlot/DXVcs2Git
        public TestLogViewModel(ArtifactsViewModel model)
        {
            this.model = model;

            Tests = GetTests(model.WorkerLog);
            Passed = Tests.All(x => x.Passed);
        }
コード例 #3
0
ファイル: RootViewModel.cs プロジェクト: i-kostikov/DXVcs2Git
        void PerformLoadTestLog()
        {
            var log = new LoadLogViewModel();

            if (LoadLogService.ShowDialog(MessageButton.OKCancel, "Load log", log) == MessageResult.OK)
            {
                string url = log.Url;
                if (string.IsNullOrEmpty(url))
                {
                    MessageBoxService.Show("Build url is not specified.", "Build log error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                var match = parseBuildRegex.Match(url);
                if (!match.Success)
                {
                    MessageBoxService.Show("Specified url doesn`t match the pattern:\r\nhttp://{server}/{namespace}/{name}/builds/{buildId}", "Build log error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                var repo      = $@"http://{match.Groups["server"]}/{match.Groups["nspace"]}/{match.Groups["name"]}.git";
                var artifacts = Repositories.SelectedBranch.DownloadArtifacts(repo, new Build()
                {
                    Id = Convert.ToInt32(match.Groups["build"].Value)
                });
                if (artifacts == null)
                {
                    MessageBoxService.Show("Build artifacts not found", "Build log error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                ArtifactsViewModel model = new ArtifactsViewModel(new ArtifactsFile()
                {
                    FileName = "test.zip"
                }, artifacts);
                ShowLogsService.Show(model);
            }
        }
コード例 #4
0
 void Initialize(ArtifactsViewModel artifact)
 {
     Modifications = new ModificationsViewModel(artifact);
     XmlLog        = new XmlLogViewModel(artifact);
     BuildLog      = new BuildLogViewModel(artifact);
     Tests         = new TestLogViewModel(artifact);
     ServerLog     = new ServerLogViewModel(artifact);
 }
コード例 #5
0
 void Initialize(ArtifactsViewModel artifact)
 {
     Modifications = new ModificationsViewModel(artifact);
     XmlLog = new XmlLogViewModel(artifact);
     BuildLog = new BuildLogViewModel(artifact);
     Tests = new TestLogViewModel(artifact);
     ServerLog = new ServerLogViewModel(artifact);
 }
コード例 #6
0
ファイル: RootViewModel.cs プロジェクト: Xarlot/DXVcs2Git
 void PerformLoadTestLog() {
     var log = new LoadLogViewModel();
     if (LoadLogService.ShowDialog(MessageButton.OKCancel, "Load log", log) == MessageResult.OK) {
         string url = log.Url;
         if (string.IsNullOrEmpty(url)) {
             MessageBoxService.Show("Build url is not specified.", "Build log error", MessageBoxButton.OK, MessageBoxImage.Error);
             return;
         }
         var match = parseBuildRegex.Match(url);
         if (!match.Success) {
             MessageBoxService.Show("Specified url doesn`t match the pattern:\r\nhttp://{server}/{namespace}/{name}/builds/{buildId}", "Build log error", MessageBoxButton.OK, MessageBoxImage.Error);
             return;
         }
         var repo = $@"http://{match.Groups["server"]}/{match.Groups["nspace"]}/{match.Groups["name"]}.git";
         var artifacts = Repositories.SelectedBranch.DownloadArtifacts(repo, new Build() { Id = Convert.ToInt32(match.Groups["build"].Value) });
         if (artifacts == null) {
             MessageBoxService.Show("Build artifacts not found", "Build log error", MessageBoxButton.OK, MessageBoxImage.Error);
             return;
         }
         ArtifactsViewModel model = new ArtifactsViewModel(new ArtifactsFile() { FileName = "test.zip" }, artifacts);
         ShowLogsService.Show(model);
     }
 }
コード例 #7
0
 public ModificationsViewModel(ArtifactsViewModel model)
 {
     this.model = model;
     Text       = model.Modifications;
 }
コード例 #8
0
 public ServerLogViewModel(ArtifactsViewModel model)
 {
     this.model = model;
     Text = model.HasTrace ? model.Trace : "Text";
 }
コード例 #9
0
ファイル: XmlLogViewModel.cs プロジェクト: Xarlot/DXVcs2Git
 public XmlLogViewModel(ArtifactsViewModel model)
 {
     this.model = model;
     Text = model.HasContent ? model.WorkerLog : "Text";
 }
コード例 #10
0
 public ServerLogViewModel(ArtifactsViewModel model)
 {
     this.model = model;
     Text       = model.HasTrace ? model.Trace : "Text";
 }
コード例 #11
0
 public XmlLogViewModel(ArtifactsViewModel model)
 {
     this.model = model;
     Text       = model.HasContent ? model.WorkerLog : "Text";
 }
コード例 #12
0
 public ModificationsViewModel(ArtifactsViewModel model)
 {
     this.model = model;
     Text = model.Modifications;
 }