mirror of https://github.com/AMT-Cheif/Stylet.git
Minor tidying, fix stylecopy violations
This commit is contained in:
parent
545a334369
commit
044f94873a
|
@ -65,6 +65,8 @@
|
|||
<Rule Id="CA2242" Action="Warning" />
|
||||
</Rules>
|
||||
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.Features" RuleNamespace="Microsoft.CodeAnalysis.CSharp.Features">
|
||||
<Rule Id="IDE0001" Action="None" />
|
||||
<Rule Id="IDE0002" Action="None" />
|
||||
<Rule Id="IDE0003" Action="None" />
|
||||
</Rules>
|
||||
</RuleSet>
|
|
@ -56,9 +56,9 @@ namespace StyletIoC.Creation
|
|||
unchecked
|
||||
{
|
||||
int hash = 17;
|
||||
hash = hash * 23 + this.Type.GetHashCode();
|
||||
hash = (hash * 23) + this.Type.GetHashCode();
|
||||
if (this.Key != null)
|
||||
hash = hash * 23 + this.Key.GetHashCode();
|
||||
hash = (hash * 23) + this.Key.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
using StyletIoC.Internal.Creators;
|
||||
using StyletIoC.Internal.Registrations;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace StyletIoC.Internal.Builders
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace StyletIoC.Internal.Builders
|
|||
{
|
||||
try
|
||||
{
|
||||
EnsureType(candidate.Type, candidate.Base);
|
||||
BuilderBindingBase.EnsureType(candidate.Type, candidate.Base);
|
||||
this.BindImplementationToSpecificService(container, candidate.Type, candidate.Base, this.ServiceType.Key);
|
||||
}
|
||||
catch (StyletIoCRegistrationException e)
|
||||
|
|
|
@ -54,11 +54,12 @@ namespace Stylet
|
|||
private Func<Type, object> _viewFactory; // This is assigned by the ctor
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets the delegate used to retrieve an instance of a view
|
||||
/// Gets or sets the delegate used to retrieve an instance of a view
|
||||
/// </summary>
|
||||
public Func<Type, object> ViewFactory
|
||||
{
|
||||
get { return this._viewFactory; }set
|
||||
get { return this._viewFactory; }
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
throw new ArgumentNullException();
|
||||
|
@ -69,7 +70,7 @@ namespace Stylet
|
|||
private List<Assembly> _viewAssemblies; // This is assigned by the ctor
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets the assemblies which are used for IoC container auto-binding and searching for Views.
|
||||
/// Gets or sets the assemblies which are used for IoC container auto-binding and searching for Views.
|
||||
/// </summary>
|
||||
public List<Assembly> ViewAssemblies
|
||||
{
|
||||
|
@ -85,7 +86,7 @@ namespace Stylet
|
|||
private Dictionary<string, string> _namespaceTransformations = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets a set of transformations to be applied to the ViewModel's namespace: string to find -> string to replace it with
|
||||
/// Gets or sets a set of transformations to be applied to the ViewModel's namespace: string to find -> string to replace it with
|
||||
/// </summary>
|
||||
public Dictionary<string, string> NamespaceTransformations
|
||||
{
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
using Stylet.Logging;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Globalization;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Stylet.Xaml
|
||||
{
|
||||
|
@ -72,6 +72,9 @@ namespace Stylet.Xaml
|
|||
this.ActionNonExistentBehaviour = actionNonExistentBehaviour;
|
||||
this.logger = logger;
|
||||
|
||||
// If a 'backupSubject' was given, bind both that and 'subject' to this.Target (with a converter which picks the first
|
||||
// one that isn't View.InitialActionTarget). If it wasn't given, just bind 'subject'.
|
||||
|
||||
var actionTargetBinding = new Binding()
|
||||
{
|
||||
Path = new PropertyPath(View.ActionTargetProperty),
|
||||
|
@ -162,7 +165,7 @@ namespace Stylet.Xaml
|
|||
// Make sure they know
|
||||
if (this.Target == View.InitialActionTarget)
|
||||
{
|
||||
var ex = new ActionNotSetException(String.Format("View.ActionTarget not on control {0} (method {1}). " +
|
||||
var ex = new ActionNotSetException(String.Format("View.ActionTarget not set on control {0} (method {1}). " +
|
||||
"This probably means the control hasn't inherited it from a parent, e.g. because a ContextMenu or Popup sits in the visual tree. " +
|
||||
"You will need so set 's:View.ActionTarget' explicitly. See the wiki section \"Actions\" for more details.", this.Subject, this.MethodName));
|
||||
this.logger.Error(ex);
|
||||
|
@ -172,7 +175,7 @@ namespace Stylet.Xaml
|
|||
if (this.TargetMethodInfo == null && this.ActionNonExistentBehaviour == ActionUnavailableBehaviour.Throw)
|
||||
{
|
||||
var ex = new ActionNotFoundException(String.Format("Unable to find method {0} on target {1}", this.MethodName, this.Target.GetType().Name));
|
||||
logger.Error(ex);
|
||||
this.logger.Error(ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,12 +133,7 @@ namespace Stylet.Xaml
|
|||
|
||||
// Throw is handled when the target is set
|
||||
if (this.TargetMethodInfo == null)
|
||||
{
|
||||
if (this.ActionNonExistentBehaviour == ActionUnavailableBehaviour.Disable)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
return this.ActionNonExistentBehaviour != ActionUnavailableBehaviour.Disable;
|
||||
|
||||
if (this.guardPropertyGetter == null)
|
||||
return true;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Stylet.Xaml
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue