public static void Connect(IEditorClientCallback callback) { // Connect to the service using WCF var context = new InstanceContext(callback); var pipeFactory = new DuplexChannelFactory <IEditorService>( context, ServiceConfig.Binding, new EndpointAddress(ServiceConfig.EndPointURI)); var service = pipeFactory.CreateChannel(); service.Connect(); }
public static void OpenClientChannel(IEditorClientCallback client) { // Create a new channel on a separate port (this is used for the callbacks) ClientChannel = CreateChannel(ClientPortName); // Register as client for remote object. var remoteType = new WellKnownClientTypeEntry(typeof(EditorService), ServerUrl); RemotingConfiguration.RegisterWellKnownClientType(remoteType); // Create an instance of the remote object. Service = Activator.GetObject(typeof(EditorService), ServerUrl) as EditorService; // Register the callback Service.Init(client); }
public void Init(IEditorClientCallback callback) { Callback = callback; }