Beispiel #1
0
 //TODO: Introduce code that just returns an encoded string
 //Since all that will be returned is the string itself and the
 //width and height; and an error code (potentially) why not just set it up as
 //such. I bet that the encoding of the hashtable isn't that efficient.
 public override Message Invoke(Message input)
 {
     Hashtable table = (Hashtable)input.Value;
       TranslateData(table);
       return new Message(Guid.NewGuid(), ObjectID, input.Sender,
       MessageOperationType.Return,
       Transform(table));
 }
Beispiel #2
0
 public Message Invoke(Message input)
 {
     return this[input.Receiver].Invoke(input);
 }
Beispiel #3
0
 public abstract Message Invoke(Message input);
Beispiel #4
0
 public virtual void OnSystemCall(Message incoming)
 {
     //do nothing
 }
Beispiel #5
0
 public virtual void Receive(Message incoming)
 {
     switch(incoming.OperationType)
       {
     case MessageOperationType.Pass:
       OnPass(incoming);
       break;
     case MessageOperationType.Execute:
       OnExecute(incoming);
       break;
     case MessageOperationType.Return:
       OnReturn(incoming);
       break;
     case MessageOperationType.System:
       OnSystemCall(incoming);
       break;
     case MessageOperationType.Init:
       OnInit(incoming);
       break;
     case MessageOperationType.Failure:
       throw new ArgumentException(string.Format("Error: {0}", incoming.Value));
     default:
       DispatchTo(incoming.Sender, ObjectID, MessageOperationType.Failure, "Invalid Action Given");
       break;
       }
 }
Beispiel #6
0
 public virtual void OnReturn(Message incoming)
 {
     //do nothing
 }
Beispiel #7
0
 public virtual void OnPass(Message incoming)
 {
     //do nothing
 }
Beispiel #8
0
 public virtual void OnInit(Message incoming)
 {
     //do nothing
 }
Beispiel #9
0
 public virtual void OnExecute(Message incoming)
 {
     //do nothing
 }
Beispiel #10
0
 public abstract void DispatchTo(Message mess);