public object HeaderReceived(object inetdealclient) { string serverEcho = Transfer.HeaderReceived.Context.Echo; WriteEcho(string.Format("Server header received")); if (serverEcho != null && serverEcho != "") WriteEcho(string.Format("Server echo: {0}", serverEcho)); IDealClient idc = (IDealClient)inetdealclient; if (idc.Context.Close) idc.Dispose(); else { if (!idc.Context.Synchronic) { if (idc.Context.SendMessage) idc.Send(MessagePart.Message); } if (idc.Context.ReceiveMessage) idc.Receive(MessagePart.Message); } if (!idc.Context.ReceiveMessage && !idc.Context.SendMessage) { if(CompleteEvent != null) CompleteEvent.Execute(idc.Context); if (!isAsync) completeNotice.Set(); } return idc.Context; }
/// <summary> /// The WriteEcho. /// </summary> /// <param name="message">The message<see cref="string"/>.</param> private void WriteEcho(string message) { if (EchoEvent != null) { EchoEvent.Execute(message); } }
public Labor(string name, IDeputy method) : base(() => method.Execute()) { Name = name; Laborer = new Laborer(name, method); Laborer.Labor = this; Box = new NoteBox(Laborer.LaborerName); Box.Labor = this; SerialCode = new Ussn(method.UniqueKey, 0, 0, 0, 0, DateTime.Now.ToBinary()); }