mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Adding reference source for System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.SqlXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Xml System.Xml.Linq
84 lines
2.3 KiB
C#
84 lines
2.3 KiB
C#
//-----------------------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//-----------------------------------------------------------------------------
|
|
|
|
namespace System.ServiceModel.Channels
|
|
{
|
|
using System.Runtime;
|
|
|
|
public class NetworkInterfaceMessageProperty
|
|
{
|
|
const string PropertyName = "NetworkInterfaceMessageProperty";
|
|
|
|
public NetworkInterfaceMessageProperty(int interfaceIndex)
|
|
{
|
|
this.InterfaceIndex = interfaceIndex;
|
|
}
|
|
|
|
NetworkInterfaceMessageProperty(NetworkInterfaceMessageProperty other)
|
|
{
|
|
this.InterfaceIndex = other.InterfaceIndex;
|
|
}
|
|
|
|
public static string Name
|
|
{
|
|
get { return PropertyName; }
|
|
}
|
|
|
|
public int InterfaceIndex
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public static bool TryGet(Message message, out NetworkInterfaceMessageProperty property)
|
|
{
|
|
if (message == null)
|
|
{
|
|
throw FxTrace.Exception.ArgumentNull("message");
|
|
}
|
|
|
|
return TryGet(message.Properties, out property);
|
|
}
|
|
|
|
public static bool TryGet(MessageProperties properties, out NetworkInterfaceMessageProperty property)
|
|
{
|
|
if (properties == null)
|
|
{
|
|
throw FxTrace.Exception.ArgumentNull("properties");
|
|
}
|
|
|
|
object value = null;
|
|
if (properties.TryGetValue(PropertyName, out value))
|
|
{
|
|
property = value as NetworkInterfaceMessageProperty;
|
|
}
|
|
else
|
|
{
|
|
property = null;
|
|
}
|
|
return property != null;
|
|
}
|
|
|
|
public void AddTo(Message message)
|
|
{
|
|
if (message == null)
|
|
{
|
|
throw FxTrace.Exception.ArgumentNull("message");
|
|
}
|
|
|
|
AddTo(message.Properties);
|
|
}
|
|
|
|
public void AddTo(MessageProperties properties)
|
|
{
|
|
if (properties == null)
|
|
{
|
|
throw FxTrace.Exception.ArgumentNull("properties");
|
|
}
|
|
|
|
properties.Add(NetworkInterfaceMessageProperty.Name, this);
|
|
}
|
|
}
|
|
}
|