Exemplo n.º 1
0
 /// <summary>
 /// Creates a new ScsServiceClient object.
 ///
 /// </summary>
 /// <param name="client">Underlying IScsClient object to communicate with server</param><param name="clientObject">The client object that is used to call method invokes in client side.
 ///             May be null if client has no methods to be invoked by server.</param>
 public ScsServiceClient(IScsClient client, object clientObject)
 {
     this._client                = client;
     this._clientObject          = clientObject;
     this._client.Connected     += new EventHandler(this.Client_Connected);
     this._client.Disconnected  += new EventHandler(this.Client_Disconnected);
     this._requestReplyMessenger = new RequestReplyMessenger <IScsClient>(client);
     this._requestReplyMessenger.MessageReceived += new EventHandler <MessageEventArgs>(this.RequestReplyMessenger_MessageReceived);
     this._realServiceProxy = new AutoConnectRemoteInvokeProxy <T, IScsClient>(this._requestReplyMessenger, (IConnectableClient)this);
     this.ServiceProxy      = (T)this._realServiceProxy.GetTransparentProxy();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new ScsServiceClient object.
        /// </summary>
        /// <param name="client">Underlying IScsClient object to communicate with server</param>
        /// <param name="clientObject">The client object that is used to call method invokes in client side.
        /// May be null if client has no methods to be invoked by server.</param>
        public ScsServiceClient(IScsClient client, object clientObject)
        {
            _client       = client;
            _clientObject = clientObject;

            _client.Connected    += Client_Connected;
            _client.Disconnected += Client_Disconnected;

            _requestReplyMessenger = new RequestReplyMessenger <IScsClient>(client);
            _requestReplyMessenger.MessageReceived += RequestReplyMessenger_MessageReceived;

            _realServiceProxy = new AutoConnectRemoteInvokeProxy <T, IScsClient>(_requestReplyMessenger, this);
            ServiceProxy      = (T)_realServiceProxy.GetTransparentProxy();
        }