コード例 #1
0
        private void cmdAddReceiveLocation_Click(object sender, EventArgs e)
        {
            try
            {
                BizTalkPortAndOrchsCollectorConfigEntry currentConfig;
                if (SelectedEntry != null)
                {
                    currentConfig = (BizTalkPortAndOrchsCollectorConfigEntry)SelectedEntry;
                }
                else
                {
                    if (SelectedConfig == null)
                    {
                        SelectedConfig = new BizTalkPortAndOrchsCollectorConfig();
                    }
                    currentConfig = (BizTalkPortAndOrchsCollectorConfigEntry)((ICollectorConfig)SelectedConfig).Entries[0];
                }

                if (!currentConfig.TestConnection())
                {
                    MessageBox.Show(currentConfig.LastError, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    BizTalkEditList editList = new BizTalkEditList();
                    editList.Text        = "Receive Locations";
                    editList.ColumnNames = new List <string>();
                    editList.ColumnNames.Add("Receive Port");
                    editList.ColumnNames.Add("Receive Location");
                    editList.ColumnNames.Add("Host");
                    editList.ValueColumn  = 1;
                    editList.ExcludeItems = new List <string>();
                    editList.ExcludeItems.AddRange((from s in currentConfig.ReceiveLocations
                                                    orderby s
                                                    select s).ToArray());
                    editList.Items = new List <string[]>();
                    List <ReceiveLocationInfo> list = currentConfig.GetReceiveLocationList();
                    foreach (var rl in list)
                    {
                        editList.Items.Add(new string[] { rl.ReceivePortName, rl.ReceiveLocationName, rl.HostName });
                    }
                    if (editList.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        currentConfig.ReceiveLocations.AddRange(editList.SelectedItems.ToArray());
                        LoadReceiveLocations();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
 private void cmdAddReceiveLocation_Click(object sender, EventArgs e)
 {
     try
     {
         BizTalkPortAndOrchsCollectorConfigEntry tmpentry = new BizTalkPortAndOrchsCollectorConfigEntry();
         tmpentry.SqlServer  = txtSQLServer.Text;
         tmpentry.MgmtDBName = txtDatabase.Text;
         if (!tmpentry.TestConnection())
         {
             MessageBox.Show(tmpentry.LastError, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             BizTalkEditList editList = new BizTalkEditList();
             editList.Text        = "Receive Locations";
             editList.ColumnNames = new List <string>();
             editList.ColumnNames.Add("Receive Port");
             editList.ColumnNames.Add("Receive Location");
             editList.ColumnNames.Add("Host");
             editList.ValueColumn  = 1;
             editList.ExcludeItems = new List <string>();
             editList.ExcludeItems.AddRange((from string s in lstReceiveLocations.Items
                                             orderby s
                                             select s).ToArray());
             editList.Items = new List <string[]>();
             List <ReceiveLocationInfo> list = tmpentry.GetReceiveLocationList();
             foreach (var rl in list)
             {
                 editList.Items.Add(new string[] { rl.ReceivePortName, rl.ReceiveLocationName, rl.HostName });
             }
             if (editList.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 lstReceiveLocations.Items.AddRange(editList.SelectedItems.ToArray());
             }
             SetReceiveLocationTextBox();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #3
0
 private void cmdAddOrchestration_Click(object sender, EventArgs e)
 {
     try
     {
         BizTalkPortAndOrchsCollectorConfigEntry currentConfig = (BizTalkPortAndOrchsCollectorConfigEntry)SelectedEntry;
         if (!currentConfig.TestConnection())
         {
             MessageBox.Show(currentConfig.LastError, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             BizTalkEditList editList = new BizTalkEditList();
             editList.Text        = "Orchestrations";
             editList.ColumnNames = new List <string>();
             editList.ColumnNames.Add("Orchestrations");
             editList.ValueColumn  = 1;
             editList.ExcludeItems = new List <string>();
             editList.ExcludeItems.AddRange((from string s in lstOrchestrations.Items
                                             orderby s
                                             select s).ToArray());
             editList.Items = new List <string[]>();
             List <SendPortInfo> list = currentConfig.GetOrchestrationList();
             foreach (var s in list)
             {
                 editList.Items.Add(new string[] { s.Name });
             }
             if (editList.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 lstOrchestrations.Items.AddRange(editList.SelectedItems.ToArray());
             }
             SetOrchestrationTextBox();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }