コード例 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn public void Send(int round)
        ///
        /// \brief Send this message.
        ///
        /// \par Description.
        ///      -  Send all the messages that are in the list
        ///
        /// \par Algorithm.
        ///      -  For each message in the list
        ///      -  Call BuildBaseAlgorithmMessage of the process. This method allows the process
        ///         to change the message according to process status
        ///      -  Compose a list of targets and send the message/s
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 09/05/2018
        ///
        /// \param round  (int) - The round.
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public void Send(int round)
        {
            BaseProcess process = (BaseProcess)Element;

            foreach (AttributeDictionary data in AsList())
            {
                // Duplicate the messageData
                // This is done in order to avoid the change to the messageData in
                // the method BuildBaseAlgorithmMessage
                // (The data in this object is not recovered after running so we have
                // to prevent changes to it while running)
                AttributeDictionary messageData = new AttributeDictionary();
                messageData.DeepCopy(data);
                //BaseMessage message = process.BuildBaseAlgorithmMessage(
                //    messageData[Comps.Type],
                //    messageData[Comps.Name],
                //    messageData[Comps.Fields],
                //    round,
                //    messageData[Comps.Targets]);
                process.SendWithNoEventsProcessing(messageData[Comps.Type],
                                                   messageData[Comps.Fields],
                                                   BaseProcess.SelectingMethod.Include,
                                                   messageData[Comps.Name],
                                                   messageData[Comps.Targets].AsList(),
                                                   -1, -1);
                //process.SendWithNoEventsProcessing(message, BaseProcess.SelectingMethod.Include, messageData[Comps.Targets].AsList());
            }
        }