コード例 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn public static ElementWindowPrms DisableIfTriggerInitialize(Attribute attribute, dynamic key, NetworkElement mainNetworkElement, NetworkElement.ElementDictionaries mainDictionary, NetworkElement.ElementDictionaries dictionary, InputWindows inputWindow, bool windowEdittable)
        ///
        /// \brief Disables if trigger initialize.
        ///
        /// \par Description.
        ///      -  This method is activated to set for the GUI the display parameters:
        ///         -   If the trigger is Initialize - disable the field
        ///         -   Else enable the fields
        ///
        /// \par Algorithm.
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 09/05/2018
        ///
        /// \param attribute           (Attribute) - The attribute.
        /// \param key                 (dynamic) - The key.
        /// \param mainNetworkElement  (NetworkElement) - The main network element.
        /// \param mainDictionary      (ElementDictionaries) - Dictionary of mains.
        /// \param dictionary          (ElementDictionaries) - The dictionary.
        /// \param inputWindow         (InputWindows) - The input window.
        /// \param windowEdittable     (bool) - true if window edittable.
        ///
        /// \return The ElementWindowPrms.
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public static ElementWindowPrms DisableIfTriggerInitialize(Attribute attribute, dynamic key,
                                                                   NetworkElement mainNetworkElement,
                                                                   NetworkElement.ElementDictionaries mainDictionary,
                                                                   NetworkElement.ElementDictionaries dictionary,
                                                                   InputWindows inputWindow,
                                                                   bool windowEdittable)
        {
            ElementWindowPrms prms = new ElementWindowPrms();

            attribute.DefaultNewValueFieldData(ref prms,
                                               mainNetworkElement,
                                               mainDictionary,
                                               dictionary,
                                               inputWindow,
                                               windowEdittable,
                                               attribute.Editable);
            if (((AttributeDictionary)attribute.Parent)[Comps.Trigger] == EventTriggerType.Initialize)
            {
                prms.newValueControlPrms.enable = false;
            }
            else
            {
                prms.newValueControlPrms.enable = true;
            }
            return(prms);
        }
コード例 #2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn public static ElementWindowPrms IntListPrms(Attribute attribute, dynamic key, NetworkElement mainNetworkElement, NetworkElement.ElementDictionaries mainDictionary, NetworkElement.ElementDictionaries dictionary, InputWindows inputWindow, bool windowEditable)
        ///
        /// \brief Int list prms.
        ///
        /// \par Description.
        ///      -  This method is meant to set the GUI parameters for the field Targets of the messages
        ///      -  Each message contains a list of ints which are target for the message
        ///      -  This method is added to each possible target of the message
        ///      -  The purpose of this message is to assign a check that the target entered (a process id)
        ///         exists in the network been designed
        ///
        /// \par Algorithm.
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 09/05/2018
        ///
        /// \param attribute           (Attribute) - The attribute.
        /// \param key                 (dynamic) - The key.
        /// \param mainNetworkElement  (NetworkElement) - The main network element.
        /// \param mainDictionary      (ElementDictionaries) - Dictionary of mains.
        /// \param dictionary          (ElementDictionaries) - The dictionary.
        /// \param inputWindow         (InputWindows) - The input window.
        /// \param windowEditable      (bool) - true if window editable.
        ///
        /// \return The ElementWindowPrms.
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public static ElementWindowPrms IntListPrms(Attribute attribute,
                                                    dynamic key,
                                                    NetworkElement mainNetworkElement,
                                                    NetworkElement.ElementDictionaries mainDictionary,
                                                    NetworkElement.ElementDictionaries dictionary,
                                                    InputWindows inputWindow,
                                                    bool windowEditable)
        {
            ElementWindowPrms prms = new ElementWindowPrms();

            prms.newValueControlPrms.inputFieldType     = InputFieldsType.AddRemovePanel;
            prms.newValueControlPrms.addAttributeMethod = CreateProcessIdAttribute;
            return(prms);
        }
コード例 #3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn public static ElementWindowPrms MessageListPrms(Attribute attribute, dynamic key, NetworkElement mainNetworkElement, NetworkElement.ElementDictionaries mainDictionary, NetworkElement.ElementDictionaries dictionary, InputWindows inputWindow, bool windowEditable)
        ///
        /// \brief Message list prms.
        ///
        /// \par Description.
        ///      -  The BaseAlgorithmMessages is part of an event in the BaseAlgorithmHandler list
        ///      -  This method is used by the BaseAlgorithmHandler to set the GUI presentation
        ///         parameters
        ///      -  The purpose of this method is to set the EmptyMessagesData as the method that will
        ///         Create a new entry in the list (When pressing the Add button of the messages list (this object) the EmptyMessageData
        ///         will be activated in order to create a new empty message)
        ///
        /// \par Algorithm.
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 09/05/2018
        ///
        /// \param attribute           (Attribute) - The attribute.
        /// \param key                 (dynamic) - The key.
        /// \param mainNetworkElement  (NetworkElement) - The main network element.
        /// \param mainDictionary      (ElementDictionaries) - Dictionary of mains.
        /// \param dictionary          (ElementDictionaries) - The dictionary.
        /// \param inputWindow         (InputWindows) - The input window.
        /// \param windowEditable      (bool) - true if window editable.
        ///
        /// \return The ElementWindowPrms.
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public static ElementWindowPrms MessageListPrms(Attribute attribute,
                                                        dynamic key,
                                                        NetworkElement mainNetworkElement,
                                                        NetworkElement.ElementDictionaries mainDictionary,
                                                        NetworkElement.ElementDictionaries dictionary,
                                                        InputWindows inputWindow,
                                                        bool windowEditable)
        {
            ElementWindowPrms prms = new ElementWindowPrms();

            attribute.DefaultNewValueFieldData(ref prms, mainNetworkElement, mainDictionary, dictionary, inputWindow, true, true);
            prms.newValueControlPrms.addAttributeMethod = EmptyMessageData;
            return(prms);
        }
コード例 #4
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn public static ElementWindowPrms InternalEventPrms(Attribute attribute, dynamic key, NetworkElement mainNetworkElement, NetworkElement.ElementDictionaries mainDictionary, NetworkElement.ElementDictionaries dictionary, InputWindows inputWindow, bool windowEditable)
        ///
        /// \brief Internal event prms.
        ///
        /// \par Description.
        ///      -  This method sets the parameters of this class representation in the GUI
        ///      -  It meant mainly to set the CreateDefaultEvent as the method to be activated
        ///         When the Add button is pressed (When the Add button is pressed a new event
        ///         with default values will be inserted)
        ///
        /// \par Algorithm.
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 09/05/2018
        ///
        /// \param attribute           (Attribute) - The attribute.
        /// \param key                 (dynamic) - The key.
        /// \param mainNetworkElement  (NetworkElement) - The main network element.
        /// \param mainDictionary      (ElementDictionaries) - Dictionary of mains.
        /// \param dictionary          (ElementDictionaries) - The dictionary.
        /// \param inputWindow         (InputWindows) - The input window.
        /// \param windowEditable      (bool) - true if window editable.
        ///
        /// \return The ElementWindowPrms.
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public static ElementWindowPrms InternalEventPrms(Attribute attribute,
                                                          dynamic key,
                                                          NetworkElement mainNetworkElement,
                                                          NetworkElement.ElementDictionaries mainDictionary,
                                                          NetworkElement.ElementDictionaries dictionary,
                                                          InputWindows inputWindow,
                                                          bool windowEditable)
        {
            ElementWindowPrms elementWindowPrms = new ElementWindowPrms();

            elementWindowPrms.newValueControlPrms.inputFieldType     = InputFieldsType.AddRemovePanel;
            elementWindowPrms.newValueControlPrms.addAttributeMethod = CreateDefaultEvent;
            return(elementWindowPrms);
        }
コード例 #5
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn public static ElementWindowPrms MethodComboBoxPrms(Attribute attribute, dynamic key, NetworkElement mainNetworkElement, NetworkElement.ElementDictionaries mainDictionary, NetworkElement.ElementDictionaries dictionary, InputWindows inputWindow, bool windowEditable)
        ///
        /// \brief Method combo box prms.
        ///
        /// \par Description.
        ///      -  This method is used to set the parameters for a method field in the GUI
        ///      -  The purpose of this method is to set the options for the ComboBox as all the
        ///         messages which has the delegate signature
        ///
        /// \par Algorithm.
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 09/05/2018
        ///
        /// \param attribute           (Attribute) - The attribute.
        /// \param key                 (dynamic) - The key.
        /// \param mainNetworkElement  (NetworkElement) - The main network element.
        /// \param mainDictionary      (ElementDictionaries) - Dictionary of mains.
        /// \param dictionary          (ElementDictionaries) - The dictionary.
        /// \param inputWindow         (InputWindows) - The input window.
        /// \param windowEditable      (bool) - true if window editable.
        ///
        /// \return The ElementWindowPrms.
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public static ElementWindowPrms MethodComboBoxPrms(Attribute attribute,
                                                           dynamic key,
                                                           NetworkElement mainNetworkElement,
                                                           NetworkElement.ElementDictionaries mainDictionary,
                                                           NetworkElement.ElementDictionaries dictionary,
                                                           InputWindows inputWindow,
                                                           bool windowEditable)
        {
            ElementWindowPrms elementWindowPrms = new ElementWindowPrms();

            elementWindowPrms.newValueControlPrms.inputFieldType = InputFieldsType.ComboBox;
            string[] options = TypesUtility.GetInternalEventMethods().ToArray();
            elementWindowPrms.newValueControlPrms.options = options;
            elementWindowPrms.newValueControlPrms.Value   = options[0];
            return(elementWindowPrms);
        }
コード例 #6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn public static ElementWindowPrms MessageTypePrms(Attribute attribute, dynamic key, NetworkElement mainNetworkElement, NetworkElement.ElementDictionaries mainDictionary, NetworkElement.ElementDictionaries dictionary, InputWindows inputWindow, bool windowEdittable)
        ///
        /// \brief Message type prms.
        ///
        /// \par Description.
        ///      -  This method is activated to set for the GUI the display parameters for the MessageType field
        ///      -  The purpose of the message is to set the values for the ComboBox
        ///         All the message type of the algorithm + all the message types of the Base Algorithm
        ///
        /// \par Algorithm.
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 09/05/2018
        ///
        /// \param attribute           (Attribute) - The attribute.
        /// \param key                 (dynamic) - The key.
        /// \param mainNetworkElement  (NetworkElement) - The main network element.
        /// \param mainDictionary      (ElementDictionaries) - Dictionary of mains.
        /// \param dictionary          (ElementDictionaries) - The dictionary.
        /// \param inputWindow         (InputWindows) - The input window.
        /// \param windowEdittable     (bool) - true if window edittable.
        ///
        /// \return The ElementWindowPrms.
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public static ElementWindowPrms MessageTypePrms(Attribute attribute, dynamic key,
                                                        NetworkElement mainNetworkElement,
                                                        NetworkElement.ElementDictionaries mainDictionary,
                                                        NetworkElement.ElementDictionaries dictionary,
                                                        InputWindows inputWindow,
                                                        bool windowEdittable)
        {
            ElementWindowPrms prms = new ElementWindowPrms();

            prms.newValueControlPrms.inputFieldType = InputFieldsType.ComboBox;
            prms.newValueControlPrms.options        = TypesUtility.GetEnumKeysToStrings(attribute.Value.GetType().ToString()).ToArray();
            prms.newValueControlPrms.enable         = true;
            // List<string> baseMessagesTypes = TypesUtility.GetEnumKeysToStrings(typeof(bm.MessageTypes).ToString());
            // prms.newValueControlPrms.options = messagesTypes.Concat(baseMessagesTypes).ToArray();
            prms.newValueControlPrms.Value = TypesUtility.GetKeyToString(attribute.Value);
            return(prms);
        }