Example #1
0
        // For recieving and sending replies to host as far as I can tell
        private static bool ApiReceiver(SoapAPI api)
        {
            try
            {
                // Based on what myApi.MessageType is
                switch (api.MessageType)
                {
                case MessageTypes.Request:                         // Did we recieve a request for a reply from the host?
                    OnRequest?.Invoke(api, new VmsRequestEventArgs
                    {
                        Request = new VmsCommand(api)
                    });

                    break;

                case MessageTypes.Reply:                         // Did we recieve a reply from the host?
                    OnReply?.Invoke(api, new VmsReplyEventArgs
                    {
                        Reply = new VmsCommand(api)
                    });
                    break;

                default:
                    break;
                }
                return(true);
            }
            catch (Exception ex)
            {
                //MessageBox.Show("Error: " + ex.ToString());
                return(false);
            }
        }
Example #2
0
 public static void SendReply(SoapAPI api)
 {
     soapMessenger.SendApi(api);
     //MessageBox.Show("Reply sent to : " + api.SenderId + " - " + api.Name);
 }