BACnet.IP.ForeignDevicePort._createMessage C# (CSharp) Метод

_createMessage() приватный Метод

Creates a new bvlc message based on a function code
private _createMessage ( FunctionCode function ) : IBvlcMessage
function FunctionCode The function code of the message type to create
Результат IBvlcMessage
        private IBvlcMessage _createMessage(FunctionCode function)
        {
            switch(function)
            {
                case FunctionCode.Result:
                    return new ResultMessage();
                case FunctionCode.RegisterForeignDevice:
                    return new RegisterForeignDeviceMessage();
                case FunctionCode.ForwardedNpdu:
                    return new ForwardedNpduMessage();
                case FunctionCode.OriginalUnicastNpdu:
                    return new OriginalUnicastNpduMessage();
                case FunctionCode.OriginalBroadcastNpdu:
                    return new OriginalBroadcastNpduMessage();
            }

            throw new Exception("Could not create message with function " + function.ToString());
        }