示例#1
0
        protected virtual void OnWorldWassupReceived(AUSPayload payload)
        {
            this.LogMessage(payload, "Wassup - ");
            var plea = new PayloadEventArgs <AUSPayload>(payload);

            this.Invoke(this.WorldWassupReceived, plea);
        }
示例#2
0
        protected virtual void OnProgrammerGoodbyeReceived(AUSPayload payload)
        {
            this.LogMessage(payload, "Goodbye - ");
            var plea = new PayloadEventArgs <AUSPayload>(payload);

            this.Invoke(this.ProgrammerGoodbyeReceived, plea);
        }
示例#3
0
        protected override void CheckRouting(AUSPayload payload, bool isDirectMessage)
        {
            // if (payload.IsDirectMessage && !isDirectMessage) return;

            try {
                if (payload.IsLexiconTerm(LexiconTermEnum.programmer_hello_world))
                {
                    this.OnProgrammerHelloReceived(payload);
                }

                else if (payload.IsLexiconTerm(LexiconTermEnum.programmer_goodbye_world))
                {
                    this.OnProgrammerGoodbyeReceived(payload);
                }

                // And can also hear everything which : Programmer hears.

                if (payload.IsLexiconTerm(LexiconTermEnum.world_wassup_programmer))
                {
                    this.OnWorldWassupReceived(payload);
                }
            } catch (Exception ex) {
                payload.Exception = ex;
            }
            this.Reply(payload);
        }
示例#4
0
 public void LogMessage(AUSPayload payload, System.String msg)
 {
     if (IsDebugMode)
     {
         System.Diagnostics.Debug.WriteLine(msg);
         System.Diagnostics.Debug.WriteLine("payload: " + payload.SafeToString());
     }
 }
示例#5
0
 private void Reply(AUSPayload payload)
 {
     if (!System.String.IsNullOrEmpty(payload.ReplyTo))
     {
         payload.DirectMessageQueue = this.QueueName;
         this.CheckPayload(payload);
         this.RMQChannel.BasicPublish("", payload.ReplyTo, body: Encoding.UTF8.GetBytes(payload.ToJSonString()));
     }
 }
示例#6
0
        protected override void CheckRouting(AUSPayload payload, bool isDirectMessage)
        {
            // if (payload.IsDirectMessage && !isDirectMessage) return;

            try {
                if (payload.IsLexiconTerm(LexiconTermEnum.world_wassup_programmer))
                {
                    this.OnWorldWassupReceived(payload);
                }
            } catch (Exception ex) {
                payload.Exception = ex;
            }
            this.Reply(payload);
        }
示例#7
0
 /// <summary>
 /// Hello -
 /// </summary>
 public void ProgrammerHello(AUSPayload payload)
 {
     this.SendMessage(payload, "Hello - ",
                      "programmermic", "world.general.programmer.hello");
 }
示例#8
0
 partial void CheckPayload(AUSPayload payload);
示例#9
0
 protected override void CheckRouting(AUSPayload payload)
 {
     this.CheckRouting(payload, false);
 }
示例#10
0
 /// <summary>
 /// Goodbye -
 /// </summary>
 public void ProgrammerGoodbye(AUSPayload payload)
 {
     this.SendMessage(payload, "Goodbye - ",
                      "programmermic", "world.general.programmer.goodbye");
 }
示例#11
0
 /// <summary>
 /// Wassup -
 /// </summary>
 public void WorldWassup(AUSPayload payload)
 {
     this.SendMessage(payload, "Wassup - ",
                      "worldmic", "programmer.general.world.wassup");
 }