예제 #1
0
        /// <summary>
        /// Redirect the Log Messages Fromm the Connections
        /// </summary>
        /// <param name="logMessage"></param>
        public void SendRecivedEventHandler(object sender, MsgSendRecivedEventArgs e)
        {
            ConnectionInterface connection = sender as ConnectionInterface;

            if (e.msgData.type == MsgData.messageType.recived)
            {
                // Create a new Send Object!
                MsgData sendData = new MsgData(e.msgData.value, MsgData.messageType.redirect);

                if (connection.interfaceNumber == 1)
                {
                    connection2.Send(sendData);
                }
                else
                {
                    connection1.Send(sendData);
                }

                // Update the MsgLog bevore we send the Data to the Corresponding Data
                msgSendRecived(e);
            }
            else if (e.msgData.type == MsgData.messageType.send)
            {
                // Update the Msg Log with the injected Message by the User
                msgSendRecived(e);
            }
            else if (e.msgData.type == MsgData.messageType.infoPositive || e.msgData.type == MsgData.messageType.infoNegative)
            {
                msgSendRecived(e);
            }
        }
예제 #2
0
        private ConnectionInterface connection2; // Interface for the Connections

        /// <summary>
        /// Construktor
        /// </summary>
        /// <param name="obj"></param>
        public MultiConnectionInterface()
        {
            connection1 = new ConnectionInterface(1);
            connection1.interfaceNumber = 1;
            connection1.MsgSendRecived += new MsgSendRecivedEventHandler(SendRecivedEventHandler);

            connection2 = new ConnectionInterface(2);
            connection2.interfaceNumber = 2;
            connection2.MsgSendRecived += new MsgSendRecivedEventHandler(SendRecivedEventHandler);
        }
예제 #3
0
        private ConnectionInterface connection1; // Interface for the Connections


        /// <summary>
        /// Construktor
        /// </summary>
        /// <param name="obj"></param>
        public SingleConnectionInterface()
        {
            connection1 = new ConnectionInterface(1);
            connection1.MsgSendRecived += new MsgSendRecivedEventHandler(SendRecivedEventHandler);
        }