コード例 #1
0
        private void OpenButton_Click(object sender, RoutedEventArgs e)
        {
            UltimaPacketFilter filter = Filter;

            if (filter != null)
            {
                try
                {
                    if (_OpenFileDialog == null)
                    {
                        _OpenFileDialog                 = new OpenFileDialog();
                        _OpenFileDialog.Filter          = "SpyUO filter (*.filter)|*.filter";
                        _OpenFileDialog.CheckPathExists = true;
                        _OpenFileDialog.FileName        = "Filter.filter";
                        _OpenFileDialog.Title           = "Open Filter";
                    }

                    if (_OpenFileDialog.ShowDialog(App.Current.MainWindow) == true)
                    {
                        filter.Load(_OpenFileDialog.FileName);
                    }
                }
                catch (Exception ex)
                {
                    Trace.WriteLine(ex);
                }
            }
        }
コード例 #2
0
        private void StarterWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            HideLoading();

            if (e.Error != null)
            {
                ShowNotification(NotificationType.Error, e.Error);
                return;
            }

            // Set filter
            _Filter.Initialize();
            FilterView.Filter = _Filter;

            if (_Filter != null)
            {
                using (IsolatedStorageFile storage = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain, null, null))
                {
                    if (storage.FileExists(_DefaultFilter))
                    {
                        using (IsolatedStorageFileStream stream = storage.OpenFile(_DefaultFilter, FileMode.Open, FileAccess.Read, FileShare.Read))
                        {
                            if (stream != null)
                            {
                                _Filter.Load(stream);
                            }
                        }
                    }
                }
            }

            if (Globals.Instance.LegacyClientFolder != null)
            {
                ShowNotification(NotificationType.Info, String.Format("Detected classic client in folder '{0}'", Globals.Instance.LegacyClientFolder));
            }

            if (Globals.Instance.EnhancedClientFolder != null)
            {
                ShowNotification(NotificationType.Info, String.Format("Detected enhanced client in folder '{0}'", Globals.Instance.EnhancedClientFolder));
            }

            if (Globals.Instance.VlcInstallationFolder != null)
            {
                ShowNotification(NotificationType.Info, String.Format("Detected VLC player version '{0}'", VlcPlayer.GetVersion(Globals.Instance.VlcInstallationFolder)));
            }
            else
            {
                ShowNotification(NotificationType.Warning, "VLC player not installed. Some features will not be supported.");
            }

            if (Globals.Instance.ItemDefinitions != null && Globals.Instance.ItemProperties != null)
            {
                LootAnalyzerButton.IsEnabled = true;
            }
        }
コード例 #3
0
        private void StarterWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            HideLoading();

            if (e.Error != null)
            {
                ShowNotification(NotificationType.Error, e.Error);
                return;
            }

            // Set filter
            _Filter.Initialize();
            FilterView.Filter = _Filter;

            if (_Filter != null && File.Exists(_DefaultFilter))
            {
                using (FileStream stream = File.Open(_DefaultFilter, FileMode.Open))
                {
                    try
                    {
                        _Filter.Load(stream);
                    }
                    catch
                    {
                        ShowNotification(NotificationType.Warning, "Could not load filter table, using a new one...");
                    }
                }
            }

            if (Globals.Instance.LegacyClientFolder != null)
            {
                ShowNotification(NotificationType.Info, String.Format("Detected classic client in folder '{0}'", Globals.Instance.LegacyClientFolder));
            }

            if (Globals.Instance.EnhancedClientFolder != null)
            {
                ShowNotification(NotificationType.Info, String.Format("Detected enhanced client in folder '{0}'", Globals.Instance.EnhancedClientFolder));
            }

            if (Globals.Instance.VlcInstallationFolder != null)
            {
                ShowNotification(NotificationType.Info, String.Format("Detected VLC player version '{0}'", VlcPlayer.GetVersion(Globals.Instance.VlcInstallationFolder)));
            }
            else
            {
                ShowNotification(NotificationType.Warning, "VLC player not installed. Some features will not be supported.");
            }

            if (Globals.Instance.ItemDefinitions != null && Globals.Instance.ItemProperties != null)
            {
                LootAnalyzerButton.IsEnabled = true;
            }
        }