Xamarin Public Jenkins (auto-signing) e79aa3c0ed Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
2016-08-03 10:59:49 +00:00

55 lines
1.8 KiB
C#

//----------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------
namespace System.ServiceModel.Discovery
{
using System;
using System.Runtime;
using System.ServiceModel.Channels;
using System.ServiceModel.Dispatcher;
class ServiceDiscoveryInstanceContextProvider : IInstanceContextProvider, IInstanceProvider
{
DiscoveryService discoveryService;
internal ServiceDiscoveryInstanceContextProvider(DiscoveryService discoveryService)
{
Fx.Assert(discoveryService != null, "The discoveryService must be non null.");
this.discoveryService = discoveryService;
}
InstanceContext IInstanceContextProvider.GetExistingInstanceContext(Message message, IContextChannel channel)
{
// per call instance context
return null;
}
void IInstanceContextProvider.InitializeInstanceContext(InstanceContext instanceContext, Message message, IContextChannel channel)
{
}
bool IInstanceContextProvider.IsIdle(InstanceContext instanceContext)
{
return true;
}
void IInstanceContextProvider.NotifyIdle(InstanceContextIdleCallback callback, InstanceContext instanceContext)
{
}
object IInstanceProvider.GetInstance(InstanceContext instanceContext, Message message)
{
return this.discoveryService;
}
object IInstanceProvider.GetInstance(InstanceContext instanceContext)
{
return this.discoveryService;
}
void IInstanceProvider.ReleaseInstance(InstanceContext instanceContext, object instance)
{
}
}
}