Skip to content

Commit

Permalink
Cleanup stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKert committed Apr 12, 2019
1 parent 77e7aac commit 91f935e
Show file tree
Hide file tree
Showing 44 changed files with 266 additions and 426 deletions.
6 changes: 3 additions & 3 deletions src/BuildVision.Common/CustomStringFormatProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

namespace BuildVision.Common
{
Expand All @@ -23,7 +23,7 @@ public string Format(string format, object arg, IFormatProvider formatProvider)

if (format != null && arg is string)
{
var strArg = (string) arg;
var strArg = (string)arg;
switch (format.ToUpper())
{
case "U":
Expand All @@ -34,7 +34,7 @@ public string Format(string format, object arg, IFormatProvider formatProvider)
}

return arg is IFormattable
? ((IFormattable) arg).ToString(format, formatProvider)
? ((IFormattable)arg).ToString(format, formatProvider)
: arg.ToString();
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/BuildVision.Common/Extensions/DateTimeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BuildVision.Common.Extensions
{
Expand Down
3 changes: 1 addition & 2 deletions src/BuildVision.Common/GenericXmlSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
Expand Down
8 changes: 2 additions & 6 deletions src/BuildVision.Common/GithubHelper.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using BuildVision.Common;
using System;
using System.Collections.Generic;
using System;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using BuildVision.Common;

namespace BuildVision.Helpers
{
Expand Down
6 changes: 3 additions & 3 deletions src/BuildVision.Common/PropertyColumnSorter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using BuildVision.Contracts;
using System;
using System;
using System.Collections;
using System.ComponentModel;
using System.Reflection;
using BuildVision.Contracts.Exceptions;

namespace BuildVision.Common
{
Expand All @@ -23,7 +23,7 @@ public PropertyColumnSorter(ListSortDirection direction, string propertyName)

int IComparer.Compare(object x, object y)
{
return Compare((T) x, (T) y);
return Compare((T)x, (T)y);
}

protected int Compare(T x, T y)
Expand Down
12 changes: 2 additions & 10 deletions src/BuildVision.Contracts/BuildOutputFileTypes.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Runtime.Serialization;

namespace BuildVision.Contracts
namespace BuildVision.Contracts
{
/// <remarks>
/// See https://msdn.microsoft.com/en-us/library/Microsoft.VisualStudio.Shell.Interop.BuildOutputGroup.aspx
Expand Down Expand Up @@ -45,19 +43,13 @@ public class BuildOutputFileTypes
/// <summary>
/// Checks whether all properties is <c>false</c>.
/// </summary>
public bool IsEmpty
{
get
{
return !(LocalizedResourceDlls
public bool IsEmpty => !(LocalizedResourceDlls
|| XmlSerializer
|| ContentFiles
|| Built
|| SourceFiles
|| Symbols
|| Documentation);
}
}

public BuildOutputFileTypes()
{
Expand Down
8 changes: 1 addition & 7 deletions src/BuildVision.Contracts/Enums/BuildActions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BuildVision.Contracts
namespace BuildVision.Contracts
{
public enum BuildActions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Runtime.Serialization;

namespace BuildVision.Contracts
namespace BuildVision.Contracts.Exceptions
{
[Serializable]
public class ProjectNotFoundException : Exception
Expand All @@ -22,4 +22,4 @@ protected ProjectNotFoundException(SerializationInfo info, StreamingContext cont
{
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace BuildVision.Contracts
namespace BuildVision.Contracts.Exceptions
{
public class PropertyNotFoundException : Exception
{
Expand All @@ -14,9 +14,6 @@ public PropertyNotFoundException(string propertyName, Type type)

public Type Type { get; }

public override string Message
{
get { return string.Format("Property '{0}' not found in '{1}' type.", PropertyName, Type); }
}
public override string Message => string.Format("Property '{0}' not found in '{1}' type.", PropertyName, Type);
}
}
2 changes: 1 addition & 1 deletion src/BuildVision.Contracts/VisualStudioProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public class VisualStudioProject
public DateTime? BuildFinishTime { get; set; }
public TimeSpan? BuildElapsedTime { get; set; }
}
}
}
8 changes: 1 addition & 7 deletions src/BuildVision.UI/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows;

namespace BuildVision.UI
{
Expand Down
17 changes: 8 additions & 9 deletions src/BuildVision.UI/Attributes/DisplayStringAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BuildVision.UI;
using System;
using System;

namespace BuildVision.UI.Helpers
{
Expand Down Expand Up @@ -31,15 +30,15 @@ public class DisplayStringAttribute : Attribute
public static readonly DisplayStringAttribute Default = new DisplayStringAttribute();
private string _resourceName;

/// <summary>
/// The value of this attribute.
/// </summary>
public string DisplayString { get; private set; }
/// <summary>
/// The value of this attribute.
/// </summary>
public string DisplayString { get; private set; }

public string ResourceName
public string ResourceName
{
get { return _resourceName; }
set
get => _resourceName;
set
{
_resourceName = value;
DisplayString = Resources.ResourceManager.GetString(value, Resources.Culture);
Expand Down
19 changes: 9 additions & 10 deletions src/BuildVision.UI/Attributes/GridColumnAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using BuildVision.Contracts;
using BuildVision.UI;
using System;

namespace BuildVision.UI.Modelss
{
Expand All @@ -13,23 +12,23 @@ public class GridColumnAttribute : BaseGridColumnSettingsAttribute

public string ImageDictionaryUri { get; set; }

public object ExampleValue { get; set; }
public object ExampleValue { get; set; }

public string TimeSpanExampleValue
public string TimeSpanExampleValue
{
get { return ""; }
set { ExampleValue = TimeSpan.Parse(value); }
get => "";
set => ExampleValue = TimeSpan.Parse(value);
}

public string DateTimeExampleValue
{
get { return ""; }
set { ExampleValue = DateTime.Parse(value); }
get => "";
set => ExampleValue = DateTime.Parse(value);
}

public GridColumnAttribute(
string headerResourceName,
ColumnsOrder displayOrder,
string headerResourceName,
ColumnsOrder displayOrder,
bool visible)
{
Header = Resources.ResourceManager.GetString(headerResourceName, Resources.Culture);
Expand Down
4 changes: 1 addition & 3 deletions src/BuildVision.UI/Common/Logging/TraceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
using System.Text;
using System.Windows;

using Microsoft.VisualStudio.Shell;

namespace BuildVision.UI.Common.Logging
{
public static class TraceManager
Expand Down Expand Up @@ -102,7 +100,7 @@ public static string ToLogString(this Exception ex, string additionalMessage)
var msg = new StringBuilder();
if (!string.IsNullOrEmpty(additionalMessage))
msg.AppendLine(additionalMessage);

if (ex == null)
return msg.ToString();

Expand Down
Loading

0 comments on commit 91f935e

Please sign in to comment.