コード例 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn public void CheckAndChange()
        ///
        /// \brief Check and change.
        ///
        /// \par Description.
        ///      -  For each entry in the list:
        ///         -#  Extract the methods from the MessageQ of the sourceProcess (attribute in the entry)
        ///         -#  Compare this list with the list in the entry
        ///         -#  if they are identical
        ///             -#  Ask the user if to perform the change
        ///         -#  If the answer is yes perform the order change using a method of the MessageQ class
        ///
        /// \par Algorithm.
        ///
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 14/05/2018
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public void CheckAndChange()
        {
            MessageQ messageQ = Element.or[bp.ork.MessageQ];

            if (Count > 0)
            {
                for (int idx = 0; idx < Count; idx++)
                {
                    AttributeList channelMessages;
                    int           sourceProcess = this[idx][Comps.SourceProcess];
                    List <int>    messageIdxs   = messageQ.ExstractChannelMessages(sourceProcess, out channelMessages);
                    if (channelMessages.CheckEqual(0, "", (AttributeList)this[idx][Comps.MessageQ]))
                    {
                        List <int> permutations = this[idx][Comps.Permutations].AsList();
                        if (PerformQuestion(this[idx], messageIdxs))
                        {
                            messageQ.ChangeOrder(permutations, sourceProcess);
                        }
                    }
                }
            }
        }