Browse Source

Stylecop fixes.

pull/58/head
Steven Kirk 11 years ago
parent
commit
254eaac9fa
  1. 2
      Perspex.Base/Collections/PerspexList.cs
  2. 14
      Perspex.Base/GlobalSuppressions.cs
  3. 1
      Perspex.Base/Perspex.Base.csproj
  4. 1
      Perspex.Base/PerspexObject.cs
  5. 2
      Perspex.Base/PerspexProperty.cs
  6. 7
      Perspex.Base/Platform/IPlatformThreadingInterface.cs
  7. 29
      Perspex.Base/PriorityLevel.cs
  8. 3
      Perspex.Base/Utilities/TypeUtilities.cs
  9. 2
      Tests/Perspex.Controls.UnitTests/ListBoxTests.cs

2
Perspex.Base/Collections/PerspexList.cs

@ -20,7 +20,7 @@ namespace Perspex.Collections
/// <remarks>
/// PerspexList is similar to <see cref="System.Collections.ObjectModel.ObservableCollection{T}"/>
/// except that when the <see cref="Clear"/> method is called, it notifies with a
/// <see cref="NotifyCollectionChangedAction.Remove"/> action, passing the items that were
/// <see cref="NotifyCollectionChangedAction.Remove"/> action, passing the items that were
/// removed.
/// </remarks>
public class PerspexList<T> : IPerspexList<T>, INotifyCollectionChanged, INotifyPropertyChanged

14
Perspex.Base/GlobalSuppressions.cs

@ -0,0 +1,14 @@
// -----------------------------------------------------------------------
// <copyright file="GlobalSuppressions.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(
"StyleCop.CSharp.MaintainabilityRules",
"SA1401:Fields must be private",
Justification = "PerspexProperty fields should not be private.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(
"StyleCop.CSharp.DocumentationRules",
"SA1609:Property documentation must have value",
Justification = "This rule is fscking pointless")]

1
Perspex.Base/Perspex.Base.csproj

@ -38,6 +38,7 @@
<ItemGroup>
<Compile Include="Binding.cs" />
<Compile Include="Diagnostics\PerspexObjectExtensions.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="PerspexProperty`1.cs" />
<Compile Include="PriorityBindingEntry.cs" />
<Compile Include="Collections\IPerspexList.cs" />

1
Perspex.Base/PerspexObject.cs

@ -18,7 +18,6 @@ namespace Perspex
using Serilog.Core.Enrichers;
using Perspex.Utilities;
/// <summary>
/// The priority of a binding.
/// </summary>

2
Perspex.Base/PerspexProperty.cs

@ -6,11 +6,11 @@
namespace Perspex
{
using Perspex.Utilities;
using System;
using System.Collections.Generic;
using System.Reactive.Subjects;
using System.Reflection;
using Perspex.Utilities;
/// <summary>
/// A perspex property.

7
Perspex.Base/Platform/IPlatformThreadingInterface.cs

@ -7,15 +7,16 @@
namespace Perspex.Platform
{
using System;
using System.Threading;
using System.Threading.Tasks;
using Perspex.Threading;
/// <summary>
/// Provides platform-specific services relating to threading.
/// </summary>
public interface IPlatformThreadingInterface
{
/// <summary>
/// Checks whether there are messages waiting to be processed.
/// </summary>
/// <returns>True if there are messages waiting, otherwise false.</returns>
bool HasMessages();
/// <summary>

29
Perspex.Base/PriorityLevel.cs

@ -31,21 +31,21 @@ namespace Perspex
/// </summary>
/// <remarks>
/// <para>
/// Each priority level in a <see cref="PriorityValue"/> has a current <see cref="Value"/>,
/// a list of <see cref="Bindings"/> and a <see cref="DirectValue"/>. When there are no
/// Each priority level in a <see cref="PriorityValue"/> has a current <see cref="Value"/>,
/// a list of <see cref="Bindings"/> and a <see cref="DirectValue"/>. When there are no
/// bindings present, or all bindings return <see cref="PerspexProperty.UnsetValue"/> then
/// <code>Value</code> will equal <code>DirectValue</code>.
/// <code>Value</code> will equal <code>DirectValue</code>.
/// </para>
/// <para>
/// When there are bindings present, then the latest added binding that doesn't return
/// <code>UnsetValue</code> will take precedence. The active binding is returned by the
/// <see cref="ActiveBindingIndex"/> property (which refers to the active binding's
/// <see cref="PriorityBindingEntry.Index"/> property rather than the index in
/// When there are bindings present, then the latest added binding that doesn't return
/// <code>UnsetValue</code> will take precedence. The active binding is returned by the
/// <see cref="ActiveBindingIndex"/> property (which refers to the active binding's
/// <see cref="PriorityBindingEntry.Index"/> property rather than the index in
/// <code>Bindings</code>).
/// </para>
/// <para>
/// If <code>DirectValue</code> is set while a binding is active, then it will replace the
/// current value until the active binding fires again/
/// current value until the active binding fires again.
/// </para>
/// </remarks>
internal class PriorityLevel
@ -71,9 +71,10 @@ namespace Perspex
/// Initializes a new instance of the <see cref="PriorityLevel"/> class.
/// </summary>
/// <param name="priority">The priority.</param>
/// <param name="mode">The precedence mode.</param>
/// <param name="changed">A method to be called when the current value changes.</param>
public PriorityLevel(
int priority,
int priority,
LevelPrecedenceMode mode,
Action<PriorityLevel> changed)
{
@ -115,7 +116,7 @@ namespace Perspex
public object Value { get; private set; }
/// <summary>
/// Gets the <see cref="PriorityBindingEntry.Index"/> value of the active binding, or -1
/// Gets the <see cref="PriorityBindingEntry.Index"/> value of the active binding, or -1
/// if no binding is active.
/// </summary>
public int ActiveBindingIndex { get; private set; }
@ -150,13 +151,13 @@ namespace Perspex
});
}
/// <summary>
/// <summary>
/// Invoked when an entry in <see cref="Bindings"/> changes value.
/// </summary>
/// <param name="entry">The entry that changed.</param>
private void Changed(PriorityBindingEntry entry)
{
if (mode == LevelPrecedenceMode.Latest || entry.Index >= this.ActiveBindingIndex)
if (this.mode == LevelPrecedenceMode.Latest || entry.Index >= this.ActiveBindingIndex)
{
if (entry.Value != PerspexProperty.UnsetValue)
{
@ -171,7 +172,7 @@ namespace Perspex
}
}
/// <summary>
/// <summary>
/// Invoked when an entry in <see cref="Bindings"/> completes.
/// </summary>
/// <param name="entry">The entry that completed.</param>
@ -185,7 +186,7 @@ namespace Perspex
}
}
/// <summary>
/// <summary>
/// Activates the first binding that has a value.
/// </summary>
private void ActivateFirstBinding()

3
Perspex.Base/Utilities/TypeUtilities.cs

@ -16,7 +16,8 @@ namespace Perspex.Utilities
/// </summary>
internal static class TypeUtilities
{
private static readonly Dictionary<Type, List<Type>> Conversions = new Dictionary<Type, List<Type>>() {
private static readonly Dictionary<Type, List<Type>> Conversions = new Dictionary<Type, List<Type>>()
{
{ typeof(decimal), new List<Type> { typeof(sbyte), typeof(byte), typeof(short), typeof(ushort), typeof(int), typeof(uint), typeof(long), typeof(ulong), typeof(char) } },
{ typeof(double), new List<Type> { typeof(sbyte), typeof(byte), typeof(short), typeof(ushort), typeof(int), typeof(uint), typeof(long), typeof(ulong), typeof(char), typeof(float) } },
{ typeof(float), new List<Type> { typeof(sbyte), typeof(byte), typeof(short), typeof(ushort), typeof(int), typeof(uint), typeof(long), typeof(ulong), typeof(char), typeof(float) } },

2
Tests/Perspex.Controls.UnitTests/ListBoxTests.cs

@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
// <copyright file="ItemsControlTests.cs" company="Steven Kirk">
// <copyright file="ListBoxTests.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------

Loading…
Cancel
Save