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();
        }
Example #2
0
        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);
        }
Example #3
0
 public void Init(IEditorClientCallback callback)
 {
     Callback = callback;
 }