public static List <NewPayLoad> GetOutpuValuesPayLoad(List <NodeActionOutputValue> AOVs)
        {
            List <NewPayLoad> OutputValuesPayLoad = new List <NewPayLoad>();

            if (AOVs != null) // we return empty list in case of null - no output values
            {
                foreach (NodeActionOutputValue AOV in AOVs)
                {
                    NewPayLoad PLO = new NewPayLoad(SocketMessages.ActionOutputValue);
                    PLO.AddValue(AOV.Param);
                    PLO.AddValue(AOV.Path);
                    PLO.AddEnumValue(AOV.GetParamType());
                    switch (AOV.GetParamType())
                    {
                    case NodeActionOutputValue.OutputValueType.String:
                        PLO.AddValue(AOV.ValueString);
                        break;

                    case NodeActionOutputValue.OutputValueType.ByteArray:
                        PLO.AddBytes(AOV.ValueByteArray);
                        break;

                    // TODO: add other types
                    default:
                        throw new Exception("Unknown output Value Type - " + AOV.GetParamType());
                    }
                    PLO.ClosePackage();

                    OutputValuesPayLoad.Add(PLO);
                }
            }
            return(OutputValuesPayLoad);
        }
Exemple #2
0
        internal List <NewPayLoad> GetOutpuValuesPayLoad(List <ActionOutputValue> AOVs)
        {
            List <NewPayLoad> OutputValuesPayLoad = new List <NewPayLoad>();

            foreach (ActionOutputValue AOV in AOVs)
            {
                NewPayLoad PLO = new NewPayLoad(SocketMessages.ActionOutputValue);  // Just keep it small size, TODO: use const
                PLO.AddValue(AOV.Param);
                PLO.AddEnumValue(AOV.GetParamType());
                switch (AOV.GetParamType())
                {
                case ActionOutputValue.OutputValueType.String:
                    PLO.AddValue(AOV.ValueString);
                    break;

                case ActionOutputValue.OutputValueType.ByteArray:
                    PLO.AddBytes(AOV.ValueByteArray);
                    break;

                default:
                    throw new Exception("Unknown output Value Type - " + AOV.GetParamType());
                }
                PLO.ClosePackage();

                OutputValuesPayLoad.Add(PLO);
            }
            return(OutputValuesPayLoad);
        }