Imported Upstream version 5.4.0.167

Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-08-21 15:34:15 +00:00
parent e49d6f06c0
commit 536cd135cc
12856 changed files with 563812 additions and 223249 deletions

View File

@ -34,7 +34,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
#pragma warning suppress 56503 // [....], Invalid State after dispose
#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return false;
@ -46,7 +46,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
#pragma warning suppress 56503 // [....], Invalid State after dispose
#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return false;
@ -57,6 +57,29 @@ namespace System.ServiceModel.Channels
public abstract MessageVersion Version { get; } // must never return null
internal virtual void SetProperty(string name, object value)
{
MessageProperties prop = Properties;
if (prop != null)
{
prop[name] = value;
}
}
internal virtual bool GetProperty(string name, out object result)
{
MessageProperties prop = Properties;
if (prop != null)
{
return prop.TryGetValue(name, out result);
}
result = null;
return false;
}
internal virtual RecycledMessageState RecycledMessageState
{
get { return null; }
@ -978,7 +1001,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
#pragma warning suppress 56503 // [....], Invalid State after dispose
#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return bodyWriter.IsFault;
}
@ -989,7 +1012,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
#pragma warning suppress 56503 // [....], Invalid State after dispose
#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return bodyWriter.IsEmpty;
}
@ -1000,7 +1023,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
#pragma warning suppress 56503 // [....], Invalid State after dispose
#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return headers;
}
@ -1011,7 +1034,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
#pragma warning suppress 56503 // [....], Invalid State after dispose
#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
if (properties == null)
properties = new MessageProperties();
@ -1019,12 +1042,36 @@ namespace System.ServiceModel.Channels
}
}
internal override void SetProperty(string name, object value)
{
MessageProperties prop = this.properties;
if (prop != null)
{
prop[name] = value;
}
}
internal override bool GetProperty(string name, out object result)
{
MessageProperties prop = this.properties;
if (prop != null)
{
return prop.TryGetValue(name, out result);
}
result = null;
return false;
}
public override MessageVersion Version
{
get
{
if (IsDisposed)
#pragma warning suppress 56503 // [....], Invalid State after dispose
#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return headers.MessageVersion;
}
@ -1306,7 +1353,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
#pragma warning suppress 56503 // [....], Invalid State after dispose
#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return headers;
}
@ -1522,7 +1569,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
#pragma warning suppress 56503 // [....], Invalid State after dispose
#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return headers;
}
@ -1541,7 +1588,7 @@ namespace System.ServiceModel.Channels
get
{
if (IsDisposed)
#pragma warning suppress 56503 // [....], Invalid State after dispose
#pragma warning suppress 56503 // Microsoft, Invalid State after dispose
throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this);
return properties;
}