2018-03-15 09:55:04 +01:00
|
|
|
|
/*
|
2022-01-21 16:33:52 +01:00
|
|
|
|
* Copyright (c) 2022 ETH Zürich, Educational Development and Technology (LET)
|
2018-03-15 09:55:04 +01:00
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System.ServiceModel;
|
2019-08-30 09:55:26 +02:00
|
|
|
|
using SafeExamBrowser.Communication.Contracts.Proxies;
|
2018-03-15 09:55:04 +01:00
|
|
|
|
|
2018-08-31 10:06:27 +02:00
|
|
|
|
namespace SafeExamBrowser.Communication.Proxies
|
2018-03-15 09:55:04 +01:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Default implementation of the <see cref="IProxyObjectFactory"/> utilizing WCF (<see cref="ChannelFactory"/>).
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class ProxyObjectFactory : IProxyObjectFactory
|
|
|
|
|
{
|
2018-03-16 15:46:53 +01:00
|
|
|
|
public IProxyObject CreateObject(string address)
|
2018-03-15 09:55:04 +01:00
|
|
|
|
{
|
|
|
|
|
var endpoint = new EndpointAddress(address);
|
2018-03-16 15:46:53 +01:00
|
|
|
|
var channel = ChannelFactory<IProxyObject>.CreateChannel(new NetNamedPipeBinding(NetNamedPipeSecurityMode.Transport), endpoint);
|
2018-03-15 09:55:04 +01:00
|
|
|
|
|
|
|
|
|
return channel;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|