public ClientRequestInfo(ClientInfo sender, ClientRequest request, DateTime receivedAt) { Request = request; Sender = sender; ReceivedAt = receivedAt; }
public ClientRequestInfo(ClientInfo sender, ClientRequest request) : this(sender, request, DateTime.Now) { }
/// <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); }
/// <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; }
/// <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; }
/// <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)); }