Skip to content

Commit f04a11f

Browse files
committed
Added further indicators
1 parent 7d9581e commit f04a11f

File tree

8 files changed

+114
-3
lines changed

8 files changed

+114
-3
lines changed

BuildVision.UI/BuildVision.UI.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@
205205
<Compile Include="Models\Indicators\MessagesIndicator.cs" />
206206
<Compile Include="Models\Indicators\SeparatorIndicator.cs" />
207207
<Compile Include="Models\Indicators\SuccessProjectsIndicator.cs" />
208+
<Compile Include="Models\Indicators\UpToDateProjectsIndicator.cs" />
209+
<Compile Include="Models\Indicators\WarningProjectsIndicator.cs" />
208210
<Compile Include="Models\Indicators\WarningsIndicator.cs" />
209211
<Compile Include="Models\ProjectItem.cs" />
210212
<Compile Include="Extensions\ProjectStateExtensions.cs" />
@@ -340,6 +342,11 @@
340342
<SubType>Designer</SubType>
341343
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
342344
</Page>
345+
<Page Include="Resources\BuildAction.Resources.Test.xaml">
346+
<Generator>MSBuild:Compile</Generator>
347+
<SubType>Designer</SubType>
348+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
349+
</Page>
343350
<Page Include="Resources\BuildState.Resources.xaml">
344351
<Generator>MSBuild:Compile</Generator>
345352
<SubType>Designer</SubType>
@@ -364,6 +371,11 @@
364371
<SubType>Designer</SubType>
365372
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
366373
</Page>
374+
<Page Include="Resources\BuildState.Resources.Test.xaml">
375+
<Generator>MSBuild:Compile</Generator>
376+
<SubType>Designer</SubType>
377+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
378+
</Page>
367379
<Page Include="Resources\ValueIndicator.Resources.Test.xaml">
368380
<Generator>MSBuild:Compile</Generator>
369381
<SubType>Designer</SubType>

BuildVision.UI/Models/Indicators/Core/ValueIndicator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public abstract class ValueIndicator : BindableBase
2323

2424
public int? Value => _value;
2525
public bool IsEnabled => _isEnabled;
26+
2627
public virtual string StringValue
2728
{
2829
get
@@ -126,4 +127,4 @@ private void RaiseValueChanged()
126127
OnPropertyChanged(nameof(IsEnabled));
127128
}
128129
}
129-
}
130+
}

BuildVision.UI/Models/Indicators/Core/ValueIndicatorsFactory.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ public static ObservableCollection<ValueIndicator> CreateCollection()
1515
new SeparatorIndicator(),
1616

1717
new SuccessProjectsIndicator(),
18+
new UpToDateProjectsIndicator(),
19+
new WarningProjectsIndicator(),
1820
new ErrorProjectsIndicator()
1921
};
2022
}
2123
}
22-
}
24+
}

BuildVision.UI/Models/Indicators/ErrorProjectsIndicator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ public class ErrorProjectsIndicator : ValueIndicator
2323
}
2424
}
2525
}
26-
}
26+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using BuildVision.UI.Models.Indicators.Core;
3+
using BuildVision.UI.Contracts;
4+
5+
namespace BuildVision.UI.Models.Indicators
6+
{
7+
public class UpToDateProjectsIndicator : ValueIndicator
8+
{
9+
public override string Header => Resources.UpToDateProjectsIndicator_Header;
10+
public override string Description => Resources.UpToDateProjectsIndicator_Description;
11+
12+
protected override int? GetValue(IBuildInfo buildContext)
13+
{
14+
try
15+
{
16+
return buildContext.BuildedProjects.BuildUpToDateCount;
17+
}
18+
catch (NullReferenceException)
19+
{
20+
return null;
21+
}
22+
}
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using BuildVision.UI.Models.Indicators.Core;
3+
using BuildVision.UI.Contracts;
4+
5+
namespace BuildVision.UI.Models.Indicators
6+
{
7+
public class WarningProjectsIndicator : ValueIndicator
8+
{
9+
public override string Header => Resources.WarningProjectsIndicator_Header;
10+
public override string Description => Resources.WarningProjectsIndicator_Description;
11+
12+
protected override int? GetValue(IBuildInfo buildContext)
13+
{
14+
try
15+
{
16+
return buildContext.BuildedProjects.BuildWarningsCount;
17+
}
18+
catch (NullReferenceException)
19+
{
20+
return null;
21+
}
22+
}
23+
}
24+
}

BuildVision.UI/Resources.Designer.cs

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BuildVision.UI/Resources.resx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,4 +595,16 @@ on build done</value>
595595
<data name="HideUpToDateTargetsMenuItem" xml:space="preserve">
596596
<value>Hide UpToDate targets</value>
597597
</data>
598+
<data name="WarningProjectsIndicator_Description" xml:space="preserve">
599+
<value>Number of projects with warnings</value>
600+
</data>
601+
<data name="WarningProjectsIndicator_Header" xml:space="preserve">
602+
<value>Projects with warnings</value>
603+
</data>
604+
<data name="UpToDateProjectsIndicator_Description" xml:space="preserve">
605+
<value>Number of projects which are up-to-date</value>
606+
</data>
607+
<data name="UpToDateProjectsIndicator_Header" xml:space="preserve">
608+
<value>Up-to-date Projects</value>
609+
</data>
598610
</root>

0 commit comments

Comments
 (0)