コード例 #1
0
        public void PropertyGetFetch_Type()
        {
            RoutingRule           oRule         = new RoutingRule();
            const RoutingRuleType expectedValue = RoutingRuleType.Forwarded;

            oRule.Type = expectedValue;
            Assert.IsTrue(oRule.ChangeList.ValueExists("Type", (int)expectedValue), "Type value get fetch failed");
        }
コード例 #2
0
        public void SetValue(RoutingRuleType t)
        {
            int index = (int)t;

            if (index < _cb.Items.Count)
            {
                _cb.SelectedIndex = index;
            }
        }
コード例 #3
0
 private void _routTypeCtrl_Selected(RoutingTypeControler ctrl, RoutingRuleType t)
 {
     if (t == RoutingRuleType.MessageType)
     {
         this.panelMessageContent.Visible = false;
         this.panelMessageType.Visible    = true;
         this.panelMessageType.BringToFront();
     }
     else if (t == RoutingRuleType.ContentBased)
     {
         this.panelMessageType.Visible    = false;
         this.panelMessageContent.Visible = true;
         this.panelMessageContent.BringToFront();
     }
 }
コード例 #4
0
        private bool SaveSetting()
        {
            ResponserWrapper w = this.comboBoxResponser.SelectedItem as ResponserWrapper;

            if (w == null)
            {
                return(false);
            }

            if (_cfgList != null)
            {
                foreach (PullChannelConfig cfg in _cfgList)
                {
                    if (cfg == _channelConfig)
                    {
                        continue;
                    }
                    if (cfg.ReceiverEntityID == w.Responser.EntityID)
                    {
                        MessageBox.Show(this, "Responser \"" + w.Responser.Name + "\" is already in the list.",
                                        this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.comboBoxResponser.Focus();
                        return(false);
                    }
                }
            }

            _channelConfig.ReceiverEntityID   = w.Responser.EntityID;
            _channelConfig.ReceiverEntityName = w.Responser.Name;

            _channelConfig.ProtocolType = _protocolTypeCtrl.GetValue();
            switch (_channelConfig.ProtocolType)
            {
            case ProtocolType.LPC:
                ChannelHelper.GenerateLPCChannel(_channelConfig);
                break;

            case ProtocolType.RPC_NamedPipe:
                if (_needToGenerateURI)
                {
                    ChannelHelper.GenerateWCFNamedPipeChannel(_channelConfig);
                }
                break;

            case ProtocolType.RPC_SOAP:
                if (_needToGenerateURI)
                {
                    ChannelHelper.GenerateWCFSoapChannel(_channelConfig);
                }
                break;

            case ProtocolType.RPC_TCP:
                if (_needToGenerateURI)
                {
                    ChannelHelper.GenerateWCFTcpChannel(_channelConfig);
                }
                break;

            default:
                MessageBox.Show(this, "Following protocol type is not supported by now.\r\n\r\n"
                                + this.comboBoxProtocolType.Text, this.Text,
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.comboBoxProtocolType.Focus();
                return(false);
            }

            RoutingRuleType routType = _routTypeCtrl.GetValue();

            _channelConfig.RequestContract.Type = routType;
            if (routType == RoutingRuleType.MessageType)
            {
                _channelConfig.RequestContract.MessageTypePairs.Clear();
                foreach (MessageTypePair t in this.checkedListBoxMessageType.CheckedItems)
                {
                    _channelConfig.RequestContract.MessageTypePairs.Add(t);
                }
            }
            else if (routType == RoutingRuleType.ContentBased)
            {
                string xpath = this.textBoxXPath.Text.Trim();

                if (xpath == null || xpath.Length < 1)
                {
                    MessageBox.Show(this, "Please input the XPath to access the requesting message content.",
                                    this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.textBoxXPath.Focus();
                    return(false);
                }

                _channelConfig.RequestContract.MessageTypeList.Clear();
                _channelConfig.RequestContract.ContentCriteria.XPath = xpath;
                _channelConfig.RequestContract.ContentCriteria.XPathPrefixDefinition = this.textBoxPrefix.Text.Trim();
                _channelConfig.RequestContract.ContentCriteria.RegularExpression     = this.textBoxRegExp.Text;
            }

            return(true);
        }