示例#1
0
        public Windows7ErrorDialog(ErrorReport report, INetworkStatusMonitor networkStatusMonitor,
                                   UpdateClient updateClient, AppConfig appConfig)
        {
            _report = report;
            _networkStatusMonitor = networkStatusMonitor;
            _updateClient         = updateClient;
            _appConfig            = appConfig;

            // Defaults
            Title      = "Error";
            Heading    = "An unexpected error occured.";
            Message    = _report.ExceptionMessageRaw;
            StackTrace = _report.ExceptionDetailRaw;
        }
示例#2
0
        public FormMain(ILog logger, LogInitializer logInitializer, IDirectoryLocator directoryLocator, IPreferenceManager preferenceManager,
                        PluginLoader pluginLoader, IPluginRepository pluginRepository, IController controller,
                        IDriveDetector driveDetector, ITaskbarItemFactory taskbarItemFactory, IWindowMenuFactory windowMenuFactory,
                        INetworkStatusMonitor networkStatusMonitor, UpdateClient updateClient, AppConfig appConfig)
        {
            InitializeComponent();

            Load        += OnLoad;
            FormClosing += OnFormClosing;

            _logger               = logger;
            _logInitializer       = logInitializer;
            _directoryLocator     = directoryLocator;
            _preferenceManager    = preferenceManager;
            _pluginLoader         = pluginLoader;
            _pluginRepository     = pluginRepository;
            _controller           = controller;
            _driveDetector        = driveDetector;
            _taskbarItem          = taskbarItemFactory.GetInstance(Handle);
            _windowMenuFactory    = windowMenuFactory;
            _networkStatusMonitor = networkStatusMonitor;
            _updateClient         = updateClient;
            _appConfig            = appConfig;

            progressBar.UseCustomColors = true;
            progressBar.GenerateText    = percentComplete => string.Format("{0}: {1:0.00}%", _state, percentComplete);

            var recentFiles = _preferenceManager.Preferences.RecentFiles;

            if (recentFiles.RememberRecentFiles && recentFiles.RecentBDROMPaths.Any())
            {
                textBoxInput.Text = recentFiles.RecentBDROMPaths.First();
            }

            toolsToolStripMenuItem.Visible      = false;
            debugToolStripMenuItem.Visible      = _appConfig.IsDebugMode;
            updateToolStripMenuItem.Visible     = false;
            toolStripStatusLabelOffline.Visible = false;
        }
示例#3
0
        public FormErrorReport(ErrorReport report, INetworkStatusMonitor networkStatusMonitor, UpdateClient updateClient)
        {
            InitializeComponent();

            _report = report;
            _networkStatusMonitor = networkStatusMonitor;
            _updateClient         = updateClient;

            var editorControl = new TextEditorControl();

            _editor = editorControl.Editor;

            textBoxTitle.Text = _report.Title;
            _editor.Text      = _report.Body;

            _editor.Options.ShowWhiteSpace  = false;
            _editor.Options.ShowLineNumbers = false;

            _editor.TextChanged += EditorOnTextChanged;
            _editor.SetSyntax(StandardSyntaxType.Markdown);

            editorControl.Dock = DockStyle.Fill;
            editorPanel.Controls.Add(editorControl);
        }
示例#4
0
        public FormMain(ILog logger, IDirectoryLocator directoryLocator, IPreferenceManager preferenceManager,
                        PluginLoader pluginLoader, IPluginRepository pluginRepository, IController controller,
                        IDriveDetector driveDetector, ITaskbarItemFactory taskbarItemFactory,
                        INetworkStatusMonitor networkStatusMonitor, Updater updater)
        {
            InitializeComponent();

            Load += OnLoad;

            _logger               = logger;
            _directoryLocator     = directoryLocator;
            _preferenceManager    = preferenceManager;
            _pluginLoader         = pluginLoader;
            _pluginRepository     = pluginRepository;
            _controller           = controller;
            _driveDetector        = driveDetector;
            _taskbarItem          = taskbarItemFactory.GetInstance(Handle);
            _networkStatusMonitor = networkStatusMonitor;

            _updater            = updater;
            _updater.IsPortable = _directoryLocator.IsPortable;
            _updateHelper       = new UpdateHelper(_updater, AppUtils.AppVersion)
            {
                AllowDownload = false
            };

            _progressBarToolTip = new ToolTip();
            _progressBarToolTip.SetToolTip(progressBar, null);

            progressBar.UseCustomColors = true;
            progressBar.GenerateText    = percentComplete => string.Format("{0}: {1:0.00}%", _state, percentComplete);

            playlistListView.ItemSelectionChanged += PlaylistListViewOnItemSelectionChanged;
            playlistListView.ShowAllChanged       += PlaylistListViewOnShowAllChanged;
            playlistListView.PlaylistReconfigured += PlaylistListViewOnPlaylistReconfigured;

            tracksPanel.PlaylistReconfigured += TracksPanelOnPlaylistReconfigured;

            mediaPanel.SelectedMediaChanged += MediaPanelOnSelectedMediaChanged;
            mediaPanel.Search = ShowMetadataSearchWindow;

            var updateObserver = new FormMainUpdateObserver(this,
                                                            checkForUpdatesToolStripMenuItem,
                                                            updateToolStripMenuItem,
                                                            downloadUpdateToolStripMenuItem);

            updateObserver.BeforeInstallUpdate += update => DisableUpdates();
            SystemEvents.SessionEnded          += (sender, args) => DisableUpdates();
            _updateHelper.RegisterObserver(updateObserver);

            FormClosing += OnFormClosing;

            var recentFiles = _preferenceManager.Preferences.RecentFiles;

            if (recentFiles.RememberRecentFiles && recentFiles.RecentBDROMPaths.Any())
            {
                textBoxInput.Text = recentFiles.RecentBDROMPaths.First();
            }

            InitSystemMenu();
        }
示例#5
0
        public FormMain(ILog logger, IDirectoryLocator directoryLocator, IPreferenceManager preferenceManager,
                        PluginLoader pluginLoader, IPluginRepository pluginRepository, IController controller,
                        IDriveDetector driveDetector, ITaskbarItemFactory taskbarItemFactory,
                        INetworkStatusMonitor networkStatusMonitor, Updater updater)
        {
            InitializeComponent();

            Load += OnLoad;

            _logger = logger;
            _directoryLocator = directoryLocator;
            _preferenceManager = preferenceManager;
            _pluginLoader = pluginLoader;
            _pluginRepository = pluginRepository;
            _controller = controller;
            _driveDetector = driveDetector;
            _taskbarItem = taskbarItemFactory.GetInstance(Handle);
            _networkStatusMonitor = networkStatusMonitor;

            _updater = updater;
            _updater.IsPortable = _directoryLocator.IsPortable;
            _updateHelper = new UpdateHelper(_updater, AppUtils.AppVersion) { AllowDownload = false };

            _progressBarToolTip = new ToolTip();
            _progressBarToolTip.SetToolTip(progressBar, null);

            progressBar.UseCustomColors = true;
            progressBar.GenerateText = percentComplete => string.Format("{0}: {1:0.00}%", _state, percentComplete);

            playlistListView.ItemSelectionChanged += PlaylistListViewOnItemSelectionChanged;
            playlistListView.ShowAllChanged += PlaylistListViewOnShowAllChanged;
            playlistListView.PlaylistReconfigured += PlaylistListViewOnPlaylistReconfigured;

            tracksPanel.PlaylistReconfigured += TracksPanelOnPlaylistReconfigured;

            mediaPanel.SelectedMediaChanged += MediaPanelOnSelectedMediaChanged;
            mediaPanel.Search = ShowMetadataSearchWindow;

            var updateObserver = new FormMainUpdateObserver(this,
                                                            checkForUpdatesToolStripMenuItem,
                                                            updateToolStripMenuItem,
                                                            downloadUpdateToolStripMenuItem);
            updateObserver.BeforeInstallUpdate += update => DisableUpdates();
            SystemEvents.SessionEnded += (sender, args) => DisableUpdates();
            _updateHelper.RegisterObserver(updateObserver);

            FormClosing += OnFormClosing;

            var recentFiles = _preferenceManager.Preferences.RecentFiles;
            if (recentFiles.RememberRecentFiles && recentFiles.RecentBDROMPaths.Any())
            {
                textBoxInput.Text = recentFiles.RecentBDROMPaths.First();
            }

            InitSystemMenu();
        }