mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Remove implicit conversion from LocalizedString to string
Having both way implicit conversion tend to confuse the C# compiler and really question the existence of the specific type in the first place. --HG-- branch : dev
This commit is contained in:
@@ -45,7 +45,7 @@ namespace Orchard.Commands {
|
||||
propertyInfo.SetValue(this, stringValue, null);
|
||||
}
|
||||
else {
|
||||
throw new InvalidOperationException(T("No property named {0} found of type bool, int or string.", commandSwitch));
|
||||
throw new InvalidOperationException(T("No property named {0} found of type bool, int or string.", commandSwitch).ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace Orchard.Commands {
|
||||
CheckMethodForSwitches(context.CommandDescriptor.MethodInfo, context.Switches);
|
||||
object[] invokeParameters = GetInvokeParametersForMethod(context.CommandDescriptor.MethodInfo, (context.Arguments ?? Enumerable.Empty<string>()).ToArray());
|
||||
if (invokeParameters == null) {
|
||||
throw new InvalidOperationException(T("Command arguments don't match"));
|
||||
throw new InvalidOperationException(T("Command arguments don't match").ToString());
|
||||
}
|
||||
|
||||
this.Context = context;
|
||||
@@ -105,7 +105,7 @@ namespace Orchard.Commands {
|
||||
}
|
||||
foreach (var commandSwitch in switches.Keys) {
|
||||
if (!supportedSwitches.Contains(commandSwitch)) {
|
||||
throw new InvalidOperationException(T("Method {0} does not support switch {1}.", methodInfo.Name, commandSwitch));
|
||||
throw new InvalidOperationException(T("Method {0} does not support switch {1}.", methodInfo.Name, commandSwitch).ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ namespace Orchard.Environment.Extensions {
|
||||
private Feature LoadFeature(FeatureDescriptor featureDescriptor) {
|
||||
var featureName = featureDescriptor.Name;
|
||||
string extensionName = GetExtensionForFeature(featureName);
|
||||
if (extensionName == null) throw new ArgumentException(T("Feature {0} was not found in any of the installed extensions", featureName));
|
||||
if (extensionName == null) throw new ArgumentException(T("Feature {0} was not found in any of the installed extensions", featureName).ToString());
|
||||
var extension = BuildActiveExtensions().Where(x => x.Descriptor.Name == extensionName).FirstOrDefault();
|
||||
if (extension == null) throw new InvalidOperationException(T("Extension ") + extensionName + T(" is not active"));
|
||||
|
||||
|
@@ -16,10 +16,6 @@ namespace Orchard.Localization {
|
||||
return _localized;
|
||||
}
|
||||
|
||||
public static implicit operator string(LocalizedString x) {
|
||||
return x._localized;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
var hashCode = 0;
|
||||
if (_localized != null)
|
||||
|
Reference in New Issue
Block a user