Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@ -81,30 +81,30 @@ namespace System.ServiceModel.Description
set { service_type = value; }
}
public static ServiceDescription GetService (Type type)
public static ServiceDescription GetService (Type serviceType)
{
// null Type is not rejected
ServiceDescription sd = new ServiceDescription ();
sd.ServiceType = type;
if (type != null) {
var att = type.GetCustomAttribute<ServiceBehaviorAttribute> (true);
sd.ServiceType = serviceType;
if (serviceType != null) {
var att = serviceType.GetCustomAttribute<ServiceBehaviorAttribute> (true);
if (att != null) {
sd.Name = att.Name;
sd.Namespace = att.Namespace;
}
if (sd.Name == null)
sd.Name = type.Name;
sd.Name = serviceType.Name;
if (sd.Namespace == null)
sd.Namespace = "http://tempuri.org/";
}
return sd;
}
public static ServiceDescription GetService (object wellKnown)
public static ServiceDescription GetService (object serviceImplementation)
{
// null instance is not rejected
ServiceDescription sd = new ServiceDescription ();
sd.ServiceType = wellKnown != null ? wellKnown.GetType () : null;
sd.ServiceType = serviceImplementation != null ? serviceImplementation.GetType () : null;
return sd;
}
}