示例#1
0
        public override void OnNewConnection(P4ScmProvider newScm)
        {
            if ((newScm != null) && (newScm.Connected))
            {
                IList <string> urls = newScm.GetProperties("Swarm.URL");
                if ((urls == null) || (urls.Count <= 0))
                {
                    string msg = string.Format("No Url for Swarm configured on {0}\r\n\r\n Please enter the Url for Swarm", newScm.Connection.Port);
                    MessageBox.Show(msg, Resources.P4VS);
                    SwarmUrlCB.Text = string.Empty;
                    SwarmBrowser.Navigate("about:blank");
                }
                else
                {
                    foreach (string url in urls)
                    {
                        SwarmUrlCB.Items.Add(url);
                    }
                    SwarmUrlCB.SelectedIndex = 0;

                    SwarmBrowser.Navigate(SwarmUrlCB.Items[0] as string);
                }
            }
            else
            {
                SwarmUrlCB.Text = string.Empty;
                SwarmBrowser.Navigate("about:blank");
            }
        }