diff --git a/src/BuildVision.UI/Components/ControlView.xaml b/src/BuildVision.UI/Components/ControlView.xaml
index 3faf5418..f15b1e38 100644
--- a/src/BuildVision.UI/Components/ControlView.xaml
+++ b/src/BuildVision.UI/Components/ControlView.xaml
@@ -19,130 +19,130 @@
UseLayoutRounding="True"
d:DesignHeight="148"
d:DesignWidth="697"
- d:DataContext="{d:DesignInstance viewModels:BuildVisionPaneViewModel}">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ d:DataContext="{d:DesignInstance viewModels:BuildVisionPaneViewModel, IsDesignTimeCreatable=True}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/BuildVision.UI/Components/ControlView.xaml.cs b/src/BuildVision.UI/Components/ControlView.xaml.cs
index 42e9aea6..4d0338ea 100644
--- a/src/BuildVision.UI/Components/ControlView.xaml.cs
+++ b/src/BuildVision.UI/Components/ControlView.xaml.cs
@@ -1,6 +1,8 @@
-using System.Globalization;
+using System.ComponentModel;
+using System.Globalization;
using System.Windows.Controls;
using System.Windows.Markup;
+using BuildVision.UI.ViewModels;
namespace BuildVision.UI
{
@@ -9,12 +11,23 @@ namespace BuildVision.UI
///
public partial class ControlView : UserControl
{
+ public BuildVisionPaneViewModel ViewModel
+ {
+ get => (BuildVisionPaneViewModel)DataContext;
+ set => DataContext = value;
+ }
+
public ControlView()
{
InitializeComponent();
// Ensure the current culture passed into bindings is the OS culture.
// By default, WPF uses en-US as the culture, regardless of the system settings.
Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag);
+
+ if (DesignerProperties.GetIsInDesignMode(new System.Windows.DependencyObject()))
+ {
+ ViewModel = new BuildVisionPaneViewModel();
+ }
}
}
}
diff --git a/src/BuildVision.UI/Components/ProjectGrid.xaml b/src/BuildVision.UI/Components/ProjectGrid.xaml
index 03aa0ee2..f2d19bcd 100644
--- a/src/BuildVision.UI/Components/ProjectGrid.xaml
+++ b/src/BuildVision.UI/Components/ProjectGrid.xaml
@@ -10,14 +10,16 @@
xmlns:helpers="clr-namespace:BuildVision.UI.Helpers"
xmlns:contracts="clr-namespace:BuildVision.Contracts;assembly=BuildVision.Contracts"
xmlns:local="clr-namespace:BuildVision.UI.Components"
+ xmlns:converters="clr-namespace:BuildVision.UI.Converters"
mc:Ignorable="d"
Background="{DynamicResource ToolWindowBackgroundKey}"
DataContextChanged="OnDataContextChanged"
SnapsToDevicePixels="True"
UseLayoutRounding="True"
+ x:Name="ProjectGridControl"
d:DesignHeight="148"
d:DesignWidth="697"
- d:DataContext="{Binding Source={StaticResource DesignViewModel}}">
+ d:DataContext="{d:DesignInstance viewModels:BuildVisionPaneViewModel, IsDesignTimeCreatable=True}">
@@ -31,13 +33,9 @@
-
-
+
-
-
-
+
@@ -73,8 +70,7 @@
-
+
@@ -92,11 +88,9 @@
+
-
-
-
+
+
+
-
+
+
+
+
-
-
+
@@ -156,7 +143,6 @@
BorderBrush="{TemplateBinding Border.BorderBrush}"
BorderThickness="0"
SnapsToDevicePixels="True">
-
-
+
-
+
@@ -190,7 +176,7 @@
-
+
@@ -198,7 +184,7 @@
-
+
@@ -206,7 +192,6 @@
-
@@ -218,37 +203,24 @@
-
+
-
-
-
@@ -267,7 +239,7 @@
-
+
@@ -275,8 +247,8 @@
-
-
+
+
@@ -308,5 +280,7 @@
MaxHeight="100" />
+
+
diff --git a/src/BuildVision.UI/Components/ProjectGrid.xaml.cs b/src/BuildVision.UI/Components/ProjectGrid.xaml.cs
index c41be47c..d01e33f3 100644
--- a/src/BuildVision.UI/Components/ProjectGrid.xaml.cs
+++ b/src/BuildVision.UI/Components/ProjectGrid.xaml.cs
@@ -1,10 +1,13 @@
using System.ComponentModel;
+using System.Diagnostics;
+using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
+using System.Windows.Markup;
using System.Windows.Media;
using BuildVision.UI.Converters;
using BuildVision.UI.DataGrid;
@@ -15,73 +18,77 @@ namespace BuildVision.UI.Components
{
public partial class ProjectGrid : UserControl
{
- private BuildVisionPaneViewModel _viewModel;
+ public BuildVisionPaneViewModel ViewModel
+ {
+ get => (BuildVisionPaneViewModel)DataContext;
+ set => DataContext = value;
+ }
public ProjectGrid()
{
InitializeComponent();
-
+ // Ensure the current culture passed into bindings is the OS culture.
+ // By default, WPF uses en-US as the culture, regardless of the system settings.
+ Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag);
Grid.TargetUpdated += GridOnTargetUpdated;
}
private void GridOnTargetUpdated(object sender, DataTransferEventArgs e)
{
- if (e.Property.Name == "ItemsSource")
+ if (e.Property.Name == nameof(Grid.ItemsSource))
+ {
RefreshSortDirectionInGrid();
+ }
}
private void RefreshSortDirectionInGrid()
{
- DataGridColumn dataGridColumn = Grid.Columns.FirstOrDefault(col => col.GetBindedProperty() == _viewModel.GridSortDescription.Property);
+ Debug.Assert(Grid.Columns != null);
+ var dataGridColumn = Grid.Columns.FirstOrDefault(col => col.GetBindedProperty() == ViewModel.GridSortDescription.Property);
if (dataGridColumn != null)
{
- dataGridColumn.SortDirection = _viewModel.GridSortDescription.Order.ToSystem();
+ dataGridColumn.SortDirection = ViewModel.GridSortDescription.Order.ToSystem();
}
}
private void GridOnSorting(object sender, DataGridSortingEventArgs e)
{
- if (_viewModel.GridSorting.CanExecute(e))
+ if (ViewModel.GridSorting.CanExecute(e))
{
- _viewModel.GridSorting.Execute(e);
+ ViewModel.GridSorting.Execute(e);
}
}
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
- _viewModel = (BuildVisionPaneViewModel)DataContext;
- _viewModel.SetGridColumnsRef(Grid.Columns);
- _viewModel.PropertyChanged += ViewModelOnPropertyChanged;
+ Debug.Assert(ViewModel != null);
+ ViewModel = (BuildVisionPaneViewModel)DataContext;
+ ViewModel.SetGridColumnsRef(Grid.Columns);
+ ViewModel.PropertyChanged += ViewModelOnPropertyChanged;
}
private void ViewModelOnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
//TODO implement logic for scrolling tu currentproject
- if (_viewModel.BuildInformationModel.CurrentProject != null && e.PropertyName == "CurrentProject")
+ if (ViewModel.BuildInformationModel.CurrentProject != null && e.PropertyName == "CurrentProject")
{
// TODO: Remove SelectedIndex = -1 and implement Unselect row feature by clicking on selected row.
Grid.SelectedIndex = -1;
if (Grid.SelectedIndex == -1)
- Grid.ScrollIntoView(_viewModel.BuildInformationModel.CurrentProject);
+ Grid.ScrollIntoView(ViewModel.BuildInformationModel.CurrentProject);
}
}
private void DataGridExpanderOnExpanded(object sender, RoutedEventArgs e)
{
- ExpanderIsExpandedConverter.SaveState(
- (Expander)sender,
- false,
- _viewModel.ControlSettings.GridSettings.CollapsedGroups);
+ ExpanderIsExpandedConverter.SaveState((Expander)sender, false, ViewModel.ControlSettings.GridSettings.CollapsedGroups);
e.Handled = true;
}
private void DataGridExpanderOnCollapsed(object sender, RoutedEventArgs e)
{
- ExpanderIsExpandedConverter.SaveState(
- (Expander)sender,
- true,
- _viewModel.ControlSettings.GridSettings.CollapsedGroups);
+ ExpanderIsExpandedConverter.SaveState((Expander)sender, true, ViewModel.ControlSettings.GridSettings.CollapsedGroups);
e.Handled = true;
}
@@ -114,12 +121,7 @@ private void DataGridRowOnPreviewMouseLeftButtonDown(object sender, MouseButtonE
{
row.Focusable = true;
row.Focus();
-
- // Gets the element with keyboard focus.
- var elementWithFocus = Keyboard.FocusedElement as UIElement;
-
- // Change keyboard focus.
- if (elementWithFocus != null)
+ if (Keyboard.FocusedElement is UIElement elementWithFocus)
{
var request = new TraversalRequest(FocusNavigationDirection.Next);
elementWithFocus.MoveFocus(request);
diff --git a/src/BuildVision.UI/Converters/ExpanderIsExpandedConverter.cs b/src/BuildVision.UI/Converters/ExpanderIsExpandedConverter.cs
index ab7d6f5d..91f6f032 100644
--- a/src/BuildVision.UI/Converters/ExpanderIsExpandedConverter.cs
+++ b/src/BuildVision.UI/Converters/ExpanderIsExpandedConverter.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Controls;
@@ -11,7 +11,7 @@ public class ExpanderIsExpandedConverter : IMultiValueConverter
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
var collectionViewGroup = (CollectionViewGroup)values[0];
- var collapsedGroups = (IList)values[1];
+ var collapsedGroups = values[1] as IList;
if (collapsedGroups == null || collapsedGroups.Count == 0)
return true;
diff --git a/src/BuildVision.UI/Models/ProjectItem.cs b/src/BuildVision.UI/Models/ProjectItem.cs
index 15f8f31b..d2bcb3fe 100644
--- a/src/BuildVision.UI/Models/ProjectItem.cs
+++ b/src/BuildVision.UI/Models/ProjectItem.cs
@@ -13,11 +13,6 @@ public class ProjectItem : BindableBase, IProjectItem
{
private const string ResourcesUri = @"Resources/ProjectItem.Resources.xaml";
- public ProjectItem()
- {
- State = ProjectState.Pending;
- }
-
public bool IsBatchBuildProject { get; set; }
private string _uniqueName;
@@ -258,6 +253,11 @@ public string SolutionFolder
}
public bool Success { get; set; }
+ public ProjectItem()
+ {
+ State = ProjectState.Pending;
+ }
+
public void RaiseBuildElapsedTimeChanged()
{
OnPropertyChanged(nameof(BuildElapsedTime));
diff --git a/src/BuildVision.UI/Settings/Models/GridSettings.cs b/src/BuildVision.UI/Settings/Models/GridSettings.cs
index 72cd7808..b936ffa2 100644
--- a/src/BuildVision.UI/Settings/Models/GridSettings.cs
+++ b/src/BuildVision.UI/Settings/Models/GridSettings.cs
@@ -50,11 +50,6 @@ public string GroupName
set => _groupName = value;
}
- ///
- /// User-friendly header format for groups.
- /// For example, "{title}: {value} - {count} items".
- /// Available arguments see in .
- ///
public string GroupHeaderFormat
{
get => _groupHeaderFormat ?? (_groupHeaderFormat = "{title}: {value}");
@@ -75,18 +70,18 @@ public SortDescription Sort
public List CollapsedGroups => _collapsedGroups ?? (_collapsedGroups = new List());
- ///
- /// Converts user-friendly string format with arguments
- /// into system format string (with {0},{1},... arguments).
- ///
private static string ConvertGroupHeaderToRawFormat(string userFriendlyFormatString)
{
if (string.IsNullOrEmpty(userFriendlyFormatString))
+ {
return string.Empty;
+ }
string rawFormat = userFriendlyFormatString;
for (int i = 0; i < GroupHeaderFormatArgs.Length; i++)
+ {
rawFormat = rawFormat.Replace("{" + GroupHeaderFormatArgs[i], "{" + i);
+ }
return rawFormat;
}
diff --git a/src/BuildVision.UI/ViewModels/BuildVisionPaneViewModel.cs b/src/BuildVision.UI/ViewModels/BuildVisionPaneViewModel.cs
index 95189a38..08242f9b 100644
--- a/src/BuildVision.UI/ViewModels/BuildVisionPaneViewModel.cs
+++ b/src/BuildVision.UI/ViewModels/BuildVisionPaneViewModel.cs
@@ -59,7 +59,7 @@ public bool HideUpToDateTargets
public ControlSettings ControlSettings { get; }
- public ObservableCollection Projects { get; set; }
+ public ObservableCollection Projects { get; }
public IBuildInformationModel BuildInformationModel { get; set; }
@@ -146,14 +146,12 @@ public ListCollectionView GroupedProjectsList
{
get
{
- var groupedList = new ListCollectionView(Projects); // todo use projects here ProjectsList);
-
+ var groupedList = new ListCollectionView(Projects);
if (!string.IsNullOrWhiteSpace(GridGroupPropertyName))
{
Debug.Assert(groupedList.GroupDescriptions != null);
groupedList.GroupDescriptions.Add(new PropertyGroupDescription(GridGroupPropertyName));
}
-
groupedList.CustomSort = GetProjectItemSorter(GridSortDescription);
groupedList.IsLiveGrouping = true;
groupedList.IsLiveSorting = true;
@@ -183,7 +181,7 @@ public ProjectItem SelectedProjectItem
set => SetProperty(ref _selectedProjectItem, value);
}
- internal BuildVisionPaneViewModel()
+ public BuildVisionPaneViewModel()
{
ControlSettings = new ControlSettings();
BuildInformationModel = new BuildInformationModel();
@@ -347,7 +345,10 @@ private void CopyErrorMessageToClipboard(ProjectItem projectItem)
public ICommand GridSorting => new RelayCommand(obj => ReorderGrid(obj));
- public ICommand GridGroupPropertyMenuItemClicked => new RelayCommand(obj => GridGroupPropertyName = (obj != null) ? obj.ToString() : string.Empty);
+ public ICommand GridGroupPropertyMenuItemClicked => new RelayCommand(obj =>
+ {
+ GridGroupPropertyName = (obj != null) ? obj.ToString() : string.Empty;
+ });
public ICommand SelectedProjectOpenContainingFolderAction => new RelayCommand(obj => OpenContainingFolder(), canExecute: obj => (SelectedProjectItem != null && !string.IsNullOrEmpty(SelectedProjectItem.FullName)));
diff --git a/src/BuildVision/BuildVision.csproj b/src/BuildVision/BuildVision.csproj
index 5581f363..95579d18 100644
--- a/src/BuildVision/BuildVision.csproj
+++ b/src/BuildVision/BuildVision.csproj
@@ -84,6 +84,7 @@
+
diff --git a/src/BuildVision/Extensions/BuildStateExtensions.cs b/src/BuildVision/Extensions/BuildStateExtensions.cs
new file mode 100644
index 00000000..9d57c88f
--- /dev/null
+++ b/src/BuildVision/Extensions/BuildStateExtensions.cs
@@ -0,0 +1,35 @@
+using System.Windows.Shell;
+using BuildVision.Contracts;
+
+namespace BuildVision.Extensions
+{
+ public static class BuildStateExtensions
+ {
+ public static TaskbarItemProgressState ToTaskBarItemProgressState(this BuildState buildState, BuildScopes buildScope)
+ {
+ var progressState = TaskbarItemProgressState.Normal;
+ if (buildState == BuildState.Cancelled)
+ {
+ progressState = TaskbarItemProgressState.Paused;
+ }
+ else if (buildState == BuildState.Failed)
+ {
+ progressState = TaskbarItemProgressState.Error;
+ }
+ else if (buildState != BuildState.InProgress)
+ {
+ progressState = TaskbarItemProgressState.None;
+ }
+ else if (buildScope != BuildScopes.BuildScopeSolution)
+ {
+ progressState = TaskbarItemProgressState.Indeterminate;
+ }
+ else
+ {
+ progressState = TaskbarItemProgressState.Normal;
+ }
+
+ return progressState;
+ }
+ }
+}
diff --git a/src/BuildVision/Services/BuildInformationProvider.cs b/src/BuildVision/Services/BuildInformationProvider.cs
index 8877e6d7..96531b42 100644
--- a/src/BuildVision/Services/BuildInformationProvider.cs
+++ b/src/BuildVision/Services/BuildInformationProvider.cs
@@ -199,7 +199,7 @@ public void BuildStarted(BuildActions buildAction, BuildScopes buildScope)
_buildOutputLogger.Attach();
ResetBuildInformationModel();
- ResetCurrentProjects();
+ ReloadCurrentProjects();
BuildInformationModel.BuildStartTime = DateTime.Now;
BuildInformationModel.BuildFinishTime = null;
@@ -267,6 +267,33 @@ public void ProjectBuildFinished(BuildActions buildAction, string projectIdentif
}
var currentProject = Projects.First(item => ProjectIdentifierGenerator.GetIdentifierForProjectItem(item) == projectIdentifier);
+ currentProject.Success = success;
+ currentProject.State = GetProjectState(success, canceled, currentProject);
+ currentProject.BuildFinishTime = DateTime.Now;
+
+ if (currentProject.State == ProjectState.BuildError && _packageSettingsProvider.Settings.GeneralSettings.StopBuildAfterFirstError)
+ {
+ _buildService.CancelBuildSolution();
+ }
+
+ BuildInformationModel.SucceededProjectsCount = Projects.Count(x => x.State == ProjectState.BuildDone || x.State == ProjectState.CleanDone);
+ BuildInformationModel.FailedProjectsCount = Projects.Count(x => x.State == ProjectState.BuildError || x.State == ProjectState.CleanError);
+ BuildInformationModel.WarnedProjectsCount = Projects.Count(x => x.State == ProjectState.BuildWarning);
+ BuildInformationModel.UpToDateProjectsCount = Projects.Count(x => x.State == ProjectState.UpToDate);
+ BuildInformationModel.MessagesCount = Projects.Sum(x => x.MessagesCount);
+ BuildInformationModel.ErrorCount = Projects.Sum(x => x.ErrorsCount);
+ BuildInformationModel.WarningsCount = Projects.Sum(x => x.WarningsCount);
+
+ if (BuildInformationModel.CurrentProject == null)
+ {
+ BuildInformationModel.CurrentProject = Projects.Last();
+ }
+
+ _taskBarInfoService.UpdateTaskBarInfo(BuildInformationModel.CurrentBuildState, BuildInformationModel.BuildScope, Projects.Count, GetFinishedProjectsCount());
+ }
+
+ private ProjectState GetProjectState(bool success, bool canceled, IProjectItem currentProject)
+ {
ProjectState projectState;
switch (BuildInformationModel.BuildAction)
{
@@ -281,10 +308,6 @@ public void ProjectBuildFinished(BuildActions buildAction, string projectIdentif
else
{
projectState = _buildOutputLogger.IsProjectUpToDate(currentProject) ? ProjectState.UpToDate : ProjectState.BuildDone;
- if (projectState == ProjectState.UpToDate)
- {
- // do i have to set errorbox here?
- }
}
}
else
@@ -299,31 +322,10 @@ public void ProjectBuildFinished(BuildActions buildAction, string projectIdentif
break;
default:
- throw new ArgumentOutOfRangeException(nameof(buildAction));
- }
- currentProject.Success = success;
- currentProject.State = projectState;
- currentProject.BuildFinishTime = DateTime.Now;
-
- if (currentProject.State == ProjectState.BuildError && _packageSettingsProvider.Settings.GeneralSettings.StopBuildAfterFirstError)
- {
- _buildService.CancelBuildSolution();
- }
-
- BuildInformationModel.SucceededProjectsCount = Projects.Count(x => x.State == ProjectState.BuildDone || x.State == ProjectState.CleanDone);
- BuildInformationModel.FailedProjectsCount = Projects.Count(x => x.State == ProjectState.BuildError || x.State == ProjectState.CleanError);
- BuildInformationModel.WarnedProjectsCount = Projects.Count(x => x.State == ProjectState.BuildWarning);
- BuildInformationModel.UpToDateProjectsCount = Projects.Count(x => x.State == ProjectState.UpToDate);
- BuildInformationModel.MessagesCount = Projects.Sum(x => x.MessagesCount);
- BuildInformationModel.ErrorCount = Projects.Sum(x => x.ErrorsCount);
- BuildInformationModel.WarningsCount = Projects.Sum(x => x.WarningsCount);
-
- if (BuildInformationModel.CurrentProject == null)
- {
- BuildInformationModel.CurrentProject = Projects.Last();
+ throw new ArgumentOutOfRangeException(nameof(BuildInformationModel.BuildAction));
}
- _taskBarInfoService.UpdateTaskBarInfo(BuildInformationModel.CurrentBuildState, BuildInformationModel.BuildScope, Projects.Count, GetFinishedProjectsCount());
+ return projectState;
}
public void BuildUpdate()
diff --git a/src/BuildVision/Services/BuildOutputLogger.cs b/src/BuildVision/Services/BuildOutputLogger.cs
index 9856f508..96fb9904 100644
--- a/src/BuildVision/Services/BuildOutputLogger.cs
+++ b/src/BuildVision/Services/BuildOutputLogger.cs
@@ -32,9 +32,9 @@ public override void Initialize(IEventSource eventSource)
{
_projects = new List();
eventSource.ProjectStarted += OnProjectStarted;
- eventSource.MessageRaised += (s, e) => EventSource_ErrorRaised(s, e, ErrorLevel.Message);
- eventSource.WarningRaised += (s, e) => EventSource_ErrorRaised(s, e, ErrorLevel.Warning);
- eventSource.ErrorRaised += (s, e) => EventSource_ErrorRaised(s, e, ErrorLevel.Error);
+ eventSource.MessageRaised += (s, e) => EventSource_ErrorRaised(e, ErrorLevel.Message);
+ eventSource.WarningRaised += (s, e) => EventSource_ErrorRaised(e, ErrorLevel.Warning);
+ eventSource.ErrorRaised += (s, e) => EventSource_ErrorRaised(e, ErrorLevel.Error);
}
private void OnProjectStarted(object sender, ProjectStartedEventArgs e)
@@ -98,12 +98,11 @@ public bool IsProjectUpToDate(IProjectItem projectItem)
return !_projects.Exists(t => t.FileName == projectItem.FullName);
}
- private void EventSource_ErrorRaised(object sender, BuildEventArgs e, ErrorLevel errorLevel)
+ private void EventSource_ErrorRaised(BuildEventArgs e, ErrorLevel errorLevel)
{
try
{
- bool verified = VerifyLoggerBuildEvent(e, errorLevel);
- if (!verified)
+ if (e.BuildEventContext.IsBuildEventContextInvalid())
return;
int projectInstanceId = e.BuildEventContext.ProjectInstanceId;
@@ -116,7 +115,9 @@ private void EventSource_ErrorRaised(object sender, BuildEventArgs e, ErrorLevel
return;
}
if (projectEntry.IsInvalid)
+ {
return;
+ }
OnErrorRaised(projectEntry, e, errorLevel);
}
@@ -126,26 +127,6 @@ private void EventSource_ErrorRaised(object sender, BuildEventArgs e, ErrorLevel
}
}
- private bool VerifyLoggerBuildEvent(BuildEventArgs eventArgs, ErrorLevel errorLevel)
- {
- if (eventArgs.BuildEventContext.IsBuildEventContextInvalid())
- return false;
-
- if (errorLevel == ErrorLevel.Message)
- {
- var messageEventArgs = (BuildMessageEventArgs)eventArgs;
- if (!messageEventArgs.IsUserMessage(this))
- return false;
- }
-
- return true;
- }
-
- public void Reset()
- {
- _projects.Clear();
- }
-
public event Action OnErrorRaised;
}
}
diff --git a/src/BuildVision/Services/TaskBarInfoService.cs b/src/BuildVision/Services/TaskBarInfoService.cs
index a1a485bb..99105d68 100644
--- a/src/BuildVision/Services/TaskBarInfoService.cs
+++ b/src/BuildVision/Services/TaskBarInfoService.cs
@@ -5,6 +5,7 @@
using System.Windows.Shell;
using BuildVision.Contracts;
using BuildVision.Exports.Services;
+using BuildVision.Extensions;
using BuildVision.UI.Models;
using BuildVision.Views.Settings;
@@ -30,21 +31,16 @@ public TaskBarInfoService(IPackageSettingsProvider packageSettingsProvider)
public void UpdateTaskBarInfo(BuildState buildState, BuildScopes buildScope, int projectsCount, int finishedProjects)
{
if (_resetTaskBarInfoCts != null && !_resetTaskBarInfoCts.IsCancellationRequested)
+ {
_resetTaskBarInfoCts.Cancel();
+ }
if (!_packageSettingsProvider.Settings.GeneralSettings.BuildProgressSettings.TaskBarProgressEnabled)
+ {
return;
+ }
- if (buildState == BuildState.Cancelled)
- _taskbarItemInfo.Value.ProgressState = TaskbarItemProgressState.Paused;
- else if (buildState == BuildState.Failed)
- _taskbarItemInfo.Value.ProgressState = TaskbarItemProgressState.Error;
- else if (buildState != BuildState.InProgress)
- _taskbarItemInfo.Value.ProgressState = TaskbarItemProgressState.None;
- else if (buildScope != BuildScopes.BuildScopeSolution)
- _taskbarItemInfo.Value.ProgressState = TaskbarItemProgressState.Indeterminate;
- else
- _taskbarItemInfo.Value.ProgressState = TaskbarItemProgressState.Normal;
+ _taskbarItemInfo.Value.ProgressState = buildState.ToTaskBarItemProgressState(buildScope); ;
if (projectsCount <= 0)
{
@@ -80,7 +76,9 @@ private void ResetTaskBarInfoOnBuildDone()
{
var buildProgressSettings = _packageSettingsProvider.Settings.GeneralSettings.BuildProgressSettings;
if (!buildProgressSettings.TaskBarProgressEnabled)
+ {
return;
+ }
switch (buildProgressSettings.ResetTaskBarProgressAfterBuildDone)
{