Ejemplo n.º 1
0
        private void RawIntelBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (RawIntelBox.SelectedItem == null)
            {
                return;
            }

            EVEData.IntelData intel = RawIntelBox.SelectedItem as EVEData.IntelData;

            foreach (string s in intel.IntelString.Split(' '))
            {
                if (s == "")
                {
                    continue;
                }

                foreach (EVEData.System sys in EVEManager.Systems)
                {
                    if (s.IndexOf(sys.Name, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        if (RegionUC.Region.Name != sys.Region)
                        {
                            RegionUC.SelectRegion(sys.Region);
                        }

                        RegionUC.SelectSystem(s, true);
                        return;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void RawIntelBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (RawIntelBox.SelectedItem == null)
            {
                return;
            }

            EVEData.IntelData intel = RawIntelBox.SelectedItem as EVEData.IntelData;

            foreach (string s in intel.IntelString.Split(' '))
            {
                if (EVEManager.Systems.Keys.Contains(s, StringComparer.OrdinalIgnoreCase))
                {
                    EVEData.System sys = EVEManager.GetEveSystem(s);
                    if (sys == null)
                    {
                        return;
                    }

                    EVEData.MapRegion rd = RegionDropDown.SelectedItem as EVEData.MapRegion;
                    if (rd.Name != sys.Region)
                    {
                        SelectRegion(sys.Region);
                    }


                    SelectSystem(s);
                    return;
                }
            }
        }
Ejemplo n.º 3
0
        private void RawIntelBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (RawIntelBox.SelectedItem == null)
            {
                return;
            }

            EVEData.IntelData chat = RawIntelBox.SelectedItem as EVEData.IntelData;

            bool selectedSystem = false;

            foreach (string s in chat.IntelString.Split(' '))
            {
                if (s == "")
                {
                    continue;
                }
                var linkParser = new Regex(@"\b(?:https?://|www\.)\S+\b", RegexOptions.Compiled | RegexOptions.IgnoreCase);
                foreach (Match m in linkParser.Matches(s))
                {
                    string url = m.Value;
                    if (!Uri.IsWellFormedUriString(url, UriKind.Absolute))
                    {
                        url = "http://" + url;
                    }
                    if (Uri.IsWellFormedUriString(url, UriKind.Absolute))
                    {
                        Process.Start(url);
                    }
                }
                // only select the first system
                if (!selectedSystem)
                {
                    foreach (EVEData.System sys in EVEManager.Systems)
                    {
                        if (s.IndexOf(sys.Name, StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            if (RegionUC.Region.Name != sys.Region)
                            {
                                RegionUC.SelectRegion(sys.Region);
                            }

                            RegionUC.SelectSystem(s, true);
                            selectedSystem = true;
                        }
                    }
                }
            }
        }