Skip to content

Commit

Permalink
Fixed errorlist
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKert committed Oct 21, 2019
1 parent f316dcf commit 3ea37b7
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/BuildVision.UI/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using System.Diagnostics;
using System.Windows;

namespace BuildVision.UI
{
Expand Down
5 changes: 3 additions & 2 deletions src/BuildVision.UI/Components/ErrorsGrid.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:contracts="clr-namespace:BuildVision.Contracts;assembly=BuildVision.Contracts"
xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
xmlns:models="clr-namespace:BuildVision.UI.Models"
xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300"
Expand Down Expand Up @@ -53,8 +54,8 @@
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="{Binding ElementName=ToolWindowTextKey, Path=Color}" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{Binding ElementName=ToolWindowTextKey, Path=Color}" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="{DynamicResource vsfx.VsColors.ToolWindowTextKey}" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{DynamicResource vsfx.VsColors.ToolWindowTextKey}" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" />
</DataGrid.Resources>
<DataGrid.Columns>
Expand Down
4 changes: 2 additions & 2 deletions src/BuildVision.UI/Components/ProjectGrid.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<Setter Property="Foreground" Value="{DynamicResource ToolWindowTextKey}" />
</Trigger>

<DataTrigger Binding="{Binding BuildInformationModel.ErrorsCount, Converter={StaticResource NumberToIsPositiveConverter}}" Value="True">
<DataTrigger Binding="{Binding ErrorsCount, Converter={StaticResource NumberToIsPositiveConverter}}" Value="True">
<Setter Property="Background" Value="PaleVioletRed" />
<Setter Property="Foreground" Value="Black" />
</DataTrigger>
Expand Down Expand Up @@ -161,7 +161,7 @@
<Setter Property="Foreground" Value="{DynamicResource ToolWindowTextKey}" />
<Setter Property="BorderThickness" Value="0,1,0,1" />
<Setter Property="BorderBrush" Value="{Binding Background, RelativeSource={RelativeSource self}}" />
<Setter Property="DetailsVisibility" Value="{Binding BuildInformationModel.ErrorsCount, Mode=OneWay, Converter={StaticResource PositiveNumberToVisibilityConverter}}" />
<Setter Property="DetailsVisibility" Value="{Binding ErrorsCount, Mode=OneWay, Converter={StaticResource PositiveNumberToVisibilityConverter}}" />
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="DataGridRowOnPreviewMouseLeftButtonDown" />

<Style.Triggers>
Expand Down
4 changes: 2 additions & 2 deletions src/BuildVision.UI/Models/SortDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ public class SortDescription

public string Property { get; set; }

public SortDescription() { }

public SortDescription(SortOrder order, string property)
{
Order = order;
Property = property;
}

public SortDescription() { }
}
}
4 changes: 2 additions & 2 deletions src/BuildVision.UI/Models/WindowStateAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ public class WindowStateAction
{
public WindowState State { get; set; }

public WindowStateAction() { }

public WindowStateAction(WindowState state)
{
State = state;
}

public WindowStateAction() { }
}
}
3 changes: 3 additions & 0 deletions src/BuildVision/BuildVision.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="SerilogTraceListener">
<Version>3.2.0</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup>
<UseCodebase>true</UseCodebase>
Expand Down
5 changes: 5 additions & 0 deletions src/BuildVision/Core/BuildVisionPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Serilog;
using SerilogTraceListener;
using Task = System.Threading.Tasks.Task;
using ui = Microsoft.VisualStudio.VSConstants.UICONTEXT;

Expand Down Expand Up @@ -64,6 +65,10 @@ public BuildVisionPackage()
{
_logger.Information("Starting {ProductName} with Version {PackageVersion}", Resources.ProductName, ApplicationInfo.GetPackageVersion(this));

PresentationTraceSources.Refresh();
PresentationTraceSources.DataBindingSource.Listeners.Add(new SerilogTraceListener.SerilogTraceListener(_logger));
PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Error | SourceLevels.Critical | SourceLevels.Warning;

if (Application.Current != null)
{
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
Expand Down

0 comments on commit 3ea37b7

Please sign in to comment.