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> /// <remarks>
/// PerspexList is similar to <see cref="System.Collections.ObjectModel.ObservableCollection{T}"/> /// 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 /// 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. /// removed.
/// </remarks> /// </remarks>
public class PerspexList<T> : IPerspexList<T>, INotifyCollectionChanged, INotifyPropertyChanged 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> <ItemGroup>
<Compile Include="Binding.cs" /> <Compile Include="Binding.cs" />
<Compile Include="Diagnostics\PerspexObjectExtensions.cs" /> <Compile Include="Diagnostics\PerspexObjectExtensions.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="PerspexProperty`1.cs" /> <Compile Include="PerspexProperty`1.cs" />
<Compile Include="PriorityBindingEntry.cs" /> <Compile Include="PriorityBindingEntry.cs" />
<Compile Include="Collections\IPerspexList.cs" /> <Compile Include="Collections\IPerspexList.cs" />

1
Perspex.Base/PerspexObject.cs

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

2
Perspex.Base/PerspexProperty.cs

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

7
Perspex.Base/Platform/IPlatformThreadingInterface.cs

@ -7,15 +7,16 @@
namespace Perspex.Platform namespace Perspex.Platform
{ {
using System; using System;
using System.Threading;
using System.Threading.Tasks;
using Perspex.Threading;
/// <summary> /// <summary>
/// Provides platform-specific services relating to threading. /// Provides platform-specific services relating to threading.
/// </summary> /// </summary>
public interface IPlatformThreadingInterface 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(); bool HasMessages();
/// <summary> /// <summary>

29
Perspex.Base/PriorityLevel.cs

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

3
Perspex.Base/Utilities/TypeUtilities.cs

@ -16,7 +16,8 @@ namespace Perspex.Utilities
/// </summary> /// </summary>
internal static class TypeUtilities 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(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(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) } }, { 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 2014 MIT Licence. See licence.md for more information.
// </copyright> // </copyright>
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------

Loading…
Cancel
Save