Esempio n. 1
0
 public Breakpoint(HostingElementTypes hostingElementType) :
     base(true)
 {
     Init(0);
     or[brp.ork.HostingElementType] = hostingElementType;
     or[brp.ork.Name] = TypesUtility.GetKeyToString(hostingElementType) + " Breakpoint";
 }
Esempio n. 2
0
        /**********************************************************************************************//**
        * Creates this object.
        *
        * \author  Ilan Hindy
        * \date    29/09/2016
        *
        * \param   hostingElementType  Type of the hosting element.
        * \param   enable              true to enable, false to disable.
        * \param   oprtr               The oprtr.
        * \param   parameters          Options for controlling the operation.
        * \param   name                (Optional) The name.
        * \param   indexInList         (Optional) List of index INS.
        * \param   parameterOneToAll   (Optional) The parameter one to all.
        * \param   listEvaluationMode  (Optional) The list evaluation mode.
        *
        **************************************************************************************************/

        public void Create(HostingElementTypes hostingElementType,
                           bool enable,
                           Operators oprtr,
                           AttributeList parameters,
                           string name     = "",
                           int indexInList = 0,
                           ListParameterOneOrAll parameterOneToAll = ListParameterOneOrAll.One,
                           ListEvaluationModes listEvaluationMode  = ListEvaluationModes.OneTrueFromAllValuesToAllValues)
        {
            or[brp.ork.HostingElementType] = hostingElementType;
            or[brp.ork.Enable]             = enable;
            or[brp.ork.Operator]           = oprtr;
            or[brp.ork.Parameters]         = parameters;
            or[brp.ork.Name]                  = name;
            or[brp.ork.IndexInList]           = indexInList;
            or[brp.ork.ListParameterOneOrAll] = parameterOneToAll;
            or[brp.ork.ListEvaluationMode]    = listEvaluationMode;
        }
Esempio n. 3
0
        /**********************************************************************************************//**
        * Searches for the first attribute.
        *
        * \author  Ilan Hindy
        * \date    29/09/2016
        *
        * \exception   EvaluationException Thrown when an Evaluation error condition occurs.
        *
        * \param   network The network.
        * \param   process The process.
        * \param   channel The channel.
        * \param   message The message.
        * \param   key     The key.
        *
        * \return  The found attribute.
        *  .
        **************************************************************************************************/

        private Attribute FindAttribute(BaseNetwork network, BaseProcess process, BaseChannel channel, BaseMessage message, dynamic key)
        {
            HostingElementTypes hostingElementType = or[brp.ork.HostingElementType];
            Attribute           attribute;

            switch (hostingElementType)
            {
            case HostingElementTypes.Network:
                if ((attribute = network.FindAttribute(TypesUtility.GetKeyToString(key))) != null)
                {
                    return(attribute);
                }
                break;

            case HostingElementTypes.Process:
                if ((attribute = process.FindAttribute(TypesUtility.GetKeyToString(key))) != null)
                {
                    return(attribute);
                }
                break;

            case HostingElementTypes.Channel:
                if ((attribute = channel.FindAttribute(TypesUtility.GetKeyToString(key))) != null)
                {
                    return(attribute);
                }
                break;

            case HostingElementTypes.Message:
                if ((attribute = message.FindAttribute(TypesUtility.GetKeyToString(key))) != null)
                {
                    return(attribute);
                }
                break;

            default:
                throw new EvaluationException("Unknown hots type : " + TypesUtility.GetKeyToString(hostingElementType));
            }
            throw new EvaluationException("There is no attribute " + TypesUtility.GetKeyToString(key) +
                                          " In " + TypesUtility.GetKeyToString(hostingElementType));
        }
Esempio n. 4
0
        /**********************************************************************************************//**
        * Network element exist.
        *
        * \author  Ilan Hindy
        * \date    29/09/2016
        *
        * \param   network The network.
        * \param   process The process.
        * \param   channel The channel.
        * \param   message The message.
        *
        * \return  true if it succeeds, false if it fails.
        *  .
        **************************************************************************************************/

        private bool NetworkElementExist(BaseNetwork network, BaseProcess process, BaseChannel channel, BaseMessage message)
        {
            HostingElementTypes hostingElementType = or[brp.ork.HostingElementType];

            switch (hostingElementType)
            {
            case HostingElementTypes.Network:
                if (network == null)
                {
                    return(false);
                }
                break;

            case HostingElementTypes.Process:
                if (process == null)
                {
                    return(false);
                }
                break;

            case HostingElementTypes.Channel:
                if (channel == null)
                {
                    return(false);
                }
                break;

            case HostingElementTypes.Message:
                if (message == null)
                {
                    return(false);
                }
                break;

            default:
                return(false);
            }
            return(true);
        }