Ejemplo n.º 1
0
 public ClientRequestInfo(ClientInfo sender, ClientRequest request, DateTime receivedAt)
 {
     Request = request;
     Sender = sender;
     ReceivedAt = receivedAt;
 }
Ejemplo n.º 2
0
 public ClientRequestInfo(ClientInfo sender, ClientRequest request)
     : this(sender, request, DateTime.Now)
 {
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Sends a request to the <see cref="ServiceHelper"/> using <see cref="RemotingClient"/>.
 /// </summary>
 /// <param name="request"><see cref="ClientRequest"/> object to be sent.</param>
 public void SendRequest(ClientRequest request)
 {
     m_remotingClient.SendAsync(request);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Converts <see cref="string"/> to a <see cref="ClientRequest"/>.
        /// </summary>
        /// <param name="text">Text to be converted to a <see cref="ClientRequest"/>.</param>
        /// <returns><see cref="ClientRequest"/> object if parsing is successful; otherwise null.</returns>
        public static ClientRequest Parse(string text)
        {
            ClientRequest request = null;

            if (!string.IsNullOrEmpty(text))
            {
                string[] textSegments = text.Split(' ');

                if (textSegments.Length > 0)
                {
                    request = new ClientRequest();
                    request.Command = textSegments[0].ToUpper();

                    if (textSegments.Length == 1)
                    {
                        request.Arguments = new Arguments("");
                    }
                    else
                    {
                        request.Arguments = new Arguments(text.Remove(0, text.IndexOf(' ')));
                    }
                }
            }

            return request;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientRequestInfo"/> class.
 /// </summary>
 /// <param name="sender"><see cref="ClientInfo"/> object of the <paramref name="request"/> sender.</param>
 /// <param name="request"><see cref="ClientRequest"/> object sent by the <paramref name="sender"/>.</param>
 public ClientRequestInfo(ClientInfo sender, ClientRequest request)
 {
     Request = request;
     Sender = sender;
     ReceivedAt = DateTime.Now;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Raises the <see cref="ReceivedClientRequest"/> event.
 /// </summary>
 /// <param name="request">The <see cref="ClientRequest"/> that was received.</param>
 /// <param name="requestSender">The <see cref="ClientInfo"/> object of the <paramref name="request"/> sender.</param>
 protected virtual void OnReceivedClientRequest(ClientRequest request, ClientInfo requestSender)
 {
     if (ReceivedClientRequest != null)
         ReceivedClientRequest(this, new EventArgs<Guid, ClientRequest>(requestSender.ClientID, request));
 }