Skip to content

Commit

Permalink
Moved some files to different places
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKert committed Mar 23, 2019
1 parent 16f40a5 commit 06bf033
Show file tree
Hide file tree
Showing 36 changed files with 990 additions and 761 deletions.
12 changes: 6 additions & 6 deletions src/BuildVision.Contracts/Enums/BuildResultState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ public enum BuildResultState
{
Unknown,

RebuildSucceeded,
RebuildSucceededWithErrors,
RebuildDone,
RebuildErrorDone,
RebuildFailed,
RebuildCancelled,

BuildSucceeded,
BuildSucceededWithErrors,
BuildDone,
BuildErrorDone,
BuildFailed,
BuildCancelled,

CleanSucceeded,
CleanSucceededWithErrors,
CleanDone,
CleanErrorDone,
CleanFailed,
CleanCancelled
}
Expand Down
3 changes: 2 additions & 1 deletion src/BuildVision.Contracts/Enums/BuildState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public enum BuildState
InProgress = 1,
Done = 2,
Cancelled = 3,
Failed = 4
Failed = 4,
ErrorDone = 5
}
}
3 changes: 2 additions & 1 deletion src/BuildVision.Contracts/Enums/ProjectState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
public enum ProjectState
{
None,
Pending,
Skipped,
BuildCancelled,
Expand All @@ -14,4 +15,4 @@ public enum ProjectState
CleanError,
BuildWarning
}
}
}
6 changes: 4 additions & 2 deletions src/BuildVision.Contracts/Models/IBuildInformationModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
using System.Windows.Controls;

namespace BuildVision.Contracts.Models
{
Expand All @@ -13,12 +14,13 @@ public interface IBuildInformationModel : INotifyPropertyChanged
int ErrorCount { get; set; }
int FailedProjectsCount { get; set; }
int MessagesCount { get; set; }
BuildResultState ResultState { get; }
string StateMessage { get; set; }
int SucceededProjectsCount { get; set; }
int UpToDateProjectsCount { get; set; }
int WarnedProjectsCount { get; set; }
int WarningsCount { get; set; }
BuildResultState GetBuildState();

BuildResultState ResultState { get; }
string StateIconKey { get; }
}
}
10 changes: 6 additions & 4 deletions src/BuildVision.Exports/Factories/IBuildMessagesFactory.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
namespace BuildVision.Exports.Factories
using BuildVision.Contracts.Models;

namespace BuildVision.Exports.Factories
{
public interface IBuildMessagesFactory
{
string GetBuildBeginExtraMessage();
string GetBuildBeginMajorMessage();
string GetBuildDoneMessage();
string GetBuildBeginExtraMessage(IBuildInformationModel buildInformationModel);
string GetBuildBeginMajorMessage(IBuildInformationModel buildInformationModel);
string GetBuildDoneMessage(IBuildInformationModel buildInformationModel);
}
}
12 changes: 2 additions & 10 deletions src/BuildVision.UI/BuildVision.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
<Compile Include="Controls\Indicators\ErrorProjectsIndicator.cs" />
<Compile Include="Controls\Indicators\WarningProjectsIndicator.cs" />
<Compile Include="Controls\Indicators\WarningsIndicator.cs" />
<Compile Include="Converters\BooleanToHiddenConverter.cs" />
<Compile Include="Converters\StateIconKeyToIconConverter.cs" />
<Compile Include="Enums\ResetTaskBarItemInfoCondition.cs" />
<Compile Include="Helpers\SortDescription.cs" />
<Compile Include="Enums\SortOrder.cs" />
Expand Down Expand Up @@ -248,16 +250,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resources\BuildResult.Resources.Test.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Page>
<Page Include="Resources\BuildResult.Resources.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Page>
<Page Include="Resources\BuildAction.Resources.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
38 changes: 30 additions & 8 deletions src/BuildVision.UI/Components/ControlView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
xmlns:controls="clr-namespace:BuildVision.UI.Controls"
xmlns:components="clr-namespace:BuildVision.UI.Components"
xmlns:res="clr-namespace:BuildVision.UI"
xmlns:converters="clr-namespace:BuildVision.UI.Converters"
mc:Ignorable="d"
Name="OwnerUserControl"
Background="{DynamicResource ToolWindowBackgroundKey}"
Expand All @@ -31,12 +32,14 @@
<ResourceDictionary Source="../Styles/DataGridColumnHeaderStyle.xaml" />
<ResourceDictionary Source="../Styles/ControlViewStyle.xaml" />
<ResourceDictionary Source="../Resources/ValueIndicator.Resources.xaml" />
<ResourceDictionary Source="../Resources/BuildResult.Resources.xaml" />
</ResourceDictionary.MergedDictionaries>

<viewModels:BuildVisionPaneViewModel x:Key="DesignViewModel"/>
<helpers:BindingProxy x:Key="proxy" Data="{Binding}" />

<converters:StateIconKeyToIconConverter x:Key="StateIconKeyToIconConverter" />
<converters:BooleanToHiddenConverter x:Key="BooleanToHiddenConverter" />

</ResourceDictionary>
</UserControl.Resources>

Expand All @@ -54,9 +57,28 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<ContentControl Grid.Column="0"
Margin="0,-7,8,0"
Template="{StaticResource StandBy}" />

<Grid Grid.Column="0"
Margin="0,-7,8,0">
<ContentControl Width="32"
Height="32"
VerticalAlignment="Top"
ClipToBounds="True"
SnapsToDevicePixels="True"
UseLayoutRounding="False"
Visibility="{Binding BuildInformationModel.IsFinished, Converter={StaticResource BooleanToHiddenConverter}}"
Template="{Binding BuildInformationModel.StateIconKey, Converter={StaticResource StateIconKeyToIconConverter}}" />
<ContentControl Width="32"
Height="32"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Panel.ZIndex="1"
ClipToBounds="False"
SnapsToDevicePixels="True"
UseLayoutRounding="False"
Visibility="{Binding BuildInformationModel.IsFinished, Converter={StaticResource VisibilityToBoolConverter}}"
Template="{Binding BuildInformationModel.StateIconKey, Converter={StaticResource StateIconKeyToIconConverter}}" />
</Grid>

<TextBlock Grid.Column="1"
FontSize="18"
Expand Down Expand Up @@ -125,7 +147,7 @@
<TextBlock Margin="2,0,0,0" Text="{x:Static res:Resources.CancelBuildSolutionButtonCaption}" />
</StackPanel>
</customButtons:BuildActionButton.Content>

<customButtons:BuildActionButton.Style>
<Style TargetType="{x:Type customButtons:BuildActionButton}">
<Style.Triggers>
Expand Down Expand Up @@ -218,13 +240,13 @@

<indicators:SuccessProjectsIndicator Value="{Binding BuildInformationModel.SucceededProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-8,0,0,0" Content="{Binding BuildInformationModel.SucceededProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />

<indicators:UpToDateProjectsIndicator Value="{Binding BuildInformationModel.UpToDateProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.UpToDateProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />

<indicators:WarningProjectsIndicator Value="{Binding BuildInformationModel.WarnedProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.WarnedProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />

<indicators:ErrorProjectsIndicator Value="{Binding BuildInformationModel.FailedProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.FailedProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />

Expand Down
35 changes: 35 additions & 0 deletions src/BuildVision.UI/Converters/BooleanToHiddenConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace BuildVision.UI.Converters
{
[ValueConversion(typeof(bool), typeof(Visibility))]
public class BooleanToHiddenConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool flag = false;
if (value is bool)
{
flag = (bool)value;
}
else if (value is bool?)
{
bool? nullable = (bool?)value;
flag = (nullable.HasValue && nullable.Value);
}
return flag ? Visibility.Hidden : Visibility.Visible;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is Visibility)
{
return (Visibility)value == Visibility.Hidden;
}
return false;
}
}
}
4 changes: 2 additions & 2 deletions src/BuildVision.UI/Converters/ColumnWidthConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using System.Windows.Data;

Expand All @@ -25,4 +25,4 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
return value;
}
}
}
}
30 changes: 30 additions & 0 deletions src/BuildVision.UI/Converters/StateIconKeyToIconConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Globalization;
using System.Windows.Controls;
using System.Windows.Data;
using BuildVision.Contracts;
using BuildVision.UI.Extensions;
using BuildVision.UI.Models;

namespace BuildVision.UI.Converters
{
[ValueConversion(typeof(string), typeof(ControlTemplate))]
public class StateIconKeyToIconConverter : IValueConverter
{
public const string ResourcesUri = @"Resources/BuildState.Resources.xaml";

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var stateIconKey = (string)value;
var vector = VectorResources.TryGet(ResourcesUri, stateIconKey) ?? VectorResources.TryGet(ResourcesUri, "StandBy");
return vector;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
// hope this works.. we don´t need back conversion I guess
return value;
}
}
}

4 changes: 2 additions & 2 deletions src/BuildVision.UI/Converters/VisibilityToBooleanConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
Expand All @@ -19,4 +19,4 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
return (new BooleanToVisibilityConverter()).Convert(value, targetType, parameter, culture);
}
}
}
}
Loading

0 comments on commit 06bf033

Please sign in to comment.