/// <summary>
 /// Initializes a new instance of the <see cref="MainWindow"/> class.
 /// </summary>
 public MainWindow()
 {
     InitializeComponent();
     RegisterNavigation();
     AppearanceManager.Current.AccentColor = Colors.Green;
     ContentSource = MenuLinkGroups.First().Links.First().Source;
 }
Example #2
0
        private CarSetupsDialog([NotNull] CarObject car, CarSetupsRemoteSource forceRemoteSource = CarSetupsRemoteSource.None)
        {
            if (car == null)
            {
                throw new ArgumentNullException(nameof(car));
            }

            DataContext          = new ViewModel(car);
            DefaultContentSource = Model.ListUri;

            var linkGroup = new LinkGroupFilterable {
                DisplayName = AppStrings.Main_Setups,
                Source      = Model.ListUri,
                AddAllLink  = true,
                FilterHint  = FilterHints.CarSetups
            };

            foreach (var link in CarSetupsListPage.GetRemoteLinks(car.Id))
            {
                linkGroup.FixedLinks.Add(link);
            }

            if (forceRemoteSource != CarSetupsRemoteSource.None)
            {
                ValuesStorage.Set("CarSetupsDialog_link", CarSetupsListPage.GetRemoteSourceUri(car.Id, forceRemoteSource));
            }

            MenuLinkGroups.Add(linkGroup);
            InitializeComponent();
        }
Example #3
0
 /// <summary>
 /// Called when page is loaded.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void OnLoaded(object sender, RoutedEventArgs e)
 {
     if (ContentSource == null)
     {
         ContentSource = MenuLinkGroups.First().Links.First().Source;
     }
 }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            AppearanceManager.Current.AccentColor = Colors.DarkViolet;

            ContentSource = MenuLinkGroups.First().Links.First().Source;
        }
        public MainWindow()
        {
            InitializeComponent();
            ViewModel.LaunchMeetingAction = async uri =>
            {
                // You will not be able to comprehend how awesome this is.
                var browser = new WebBrowser();
                browser.Navigate(uri);

                await Task.Delay(500);

                WindowState = WindowState.Minimized;
            };
            Messenger.Default.Register(this, new Action <RequestNavigationEvent>(NavigationRequested));

            if (!ApplicationSettings.Current.Save())
            {
                MessageBox.Show("This application requires a configuration file to be saved in the same directory as the application. You do not have write access to the directory or configuration file. Please correct the issue.", "Settings", MessageBoxButton.OK, MessageBoxImage.Error);
                Application.Current.Shutdown(1);
            }

            if (!ApplicationSettings.Current.OutlookIntegration && ApplicationSettings.Current.HideOutlookIntegration)
            {
                MenuLinkGroups.First().Links.Remove(MenuLinkGroups.First().Links.First());
                MenuLinkGroups.First().Links.Remove(MenuLinkGroups.First().Links.First());
                ContentSource = new Uri("/Views/CustomMeetingsView.xaml", UriKind.RelativeOrAbsolute);
            }
        }
Example #6
0
        public LinkGroupFilterable OpenSubGroup(string groupKey, string displayName, Uri uri, int limit = 2)
        {
            var groupLinks   = MenuLinkGroups.OfType <LinkGroupFilterable>().Where(x => x.GroupKey == groupKey).ToList();
            var existingLink = groupLinks.FirstOrDefault(x => x.Source == uri);

            if (existingLink == null)
            {
                existingLink = new LinkGroupFilterable {
                    DisplayName = displayName,
                    GroupKey    = groupKey,
                    Source      = uri
                };

                while (groupLinks.Count >= limit)
                {
                    MenuLinkGroups.Remove(groupLinks[0]);
                    groupLinks.RemoveAt(0);
                }

                groupLinks.Add(existingLink);
                MenuLinkGroups.Add(existingLink);

                if (!_subGroupKeys.Contains(groupKey))
                {
                    _subGroupKeys.Add(groupKey);
                    ValuesStorage.Set(KeySubGroupKeys, _subGroupKeys);
                }

                ValuesStorage.Set(GetSubGroupLinksKey(groupKey),
                                  groupLinks.Select(x => Storage.EncodeList(x.DisplayName, x.Source.OriginalString)));
            }

            NavigateTo(uri);
            return(existingLink);
        }
        //public partial class MainWindow : MetroWindow {
        public MainWindow()
        {
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;

            AppearanceManager.Current.AccentColor = Colors.BlueViolet;
            ContentSource = MenuLinkGroups.First().Links.First().Source;
        }
Example #8
0
 public void AddUploadTab()
 {
     if (!UploadTabAdded)
     {
         MenuLinkGroups.Add(uploadtab);
         UploadTabAdded = true;
     }
 }
Example #9
0
 private void UpdateAboutIsNew()
 {
     TitleLinks.FirstOrDefault(x => x.DisplayName == AppStrings.Main_About)?
     .SetNew(AboutHelper.Instance.HasNewImportantTips || AboutHelper.Instance.HasNewReleaseNotes);
     MenuLinkGroups.SelectMany(x => x.Links)
     .FirstOrDefault(x => x.DisplayName == AppStrings.Main_ReleaseNotes)?
     .SetNew(AboutHelper.Instance.HasNewReleaseNotes);
     MenuLinkGroups.SelectMany(x => x.Links)
     .FirstOrDefault(x => x.DisplayName == AppStrings.Main_ImportantTips)?
     .SetNew(AboutHelper.Instance.HasNewImportantTips);
 }
Example #10
0
 private void OnAppAppearancePropertyChanged(object o, PropertyChangedEventArgs args)
 {
     if (args.PropertyName == nameof(AppAppearanceManager.Instance.DownloadsInSeparatePage))
     {
         var value = AppAppearanceManager.Instance.DownloadsInSeparatePage;
         if (_downloadListParent != null)
         {
             _downloadListParent.Child = value ? null : (FrameworkElement)FindResource(@"DownloadsMenuSection");
         }
         DownloadsEntry.IsAvailable = value;
         BrowserLinkGroup.GroupKey  = value ? @"downloads" : @"content";
         MenuLinkGroups             = new LinkGroupCollection(MenuLinkGroups.ToList());
     }
 }
Example #11
0
        public MainWindow()
        {
            InitializeComponent();
            Title = "GraphX for WPF showcase application v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion;
#if DEBUG
            var lg = new LinkGroup {
                DisplayName = "Debug"
            };
            lg.Links.Add(new Link {
                DisplayName = "Debug", Source = new Uri("Pages/Debug/DebugGraph.xaml", UriKind.Relative)
            });
            MenuLinkGroups.Add(lg);
#endif
            this.CommandBindings.Add(new CommandBinding(LinkCommands.ShowMiniSpecialDialog, OnShowMiniSpecialDialog, OnCanShowMiniSpecialDialog));
        }
        public MainWindow()
        {
            InitializeComponent();

            var dataContext = new MainWindowViewModel();

            this.DataContext = dataContext;

            dataContext.GetMenu();

            foreach (var link in dataContext.Groups)
            {
                MenuLinkGroups.Add(link);
            }
        }
Example #13
0
        private TrackSkinsDialog([NotNull] TrackObject track)
        {
            if (track == null)
            {
                throw new ArgumentNullException(nameof(track));
            }

            DataContext          = new ViewModel(track);
            DefaultContentSource = Model.ListUri;
            MenuLinkGroups.Add(new LinkGroupFilterable {
                DisplayName = AppStrings.Main_Skins,
                Source      = Model.ListUri,
                FilterHint  = FilterHints.TrackSkins
            });

            InitializeComponent();
        }
Example #14
0
        private CarSkinsDialog([NotNull] CarObject car)
        {
            if (car == null)
            {
                throw new ArgumentNullException(nameof(car));
            }

            DataContext = new ViewModel(car);

            DefaultContentSource = Model.ListUri;
            MenuLinkGroups.Add(new LinkGroupFilterable {
                DisplayName = AppStrings.Main_Skins,
                Source      = Model.ListUri
            });

            InitializeComponent();
        }
Example #15
0
        private void InitializeSubGroups()
        {
            _subGroupKeys = ValuesStorage.GetStringList(KeySubGroupKeys).ToList();
            foreach (var groupKey in _subGroupKeys)
            {
                foreach (var p in ValuesStorage.GetStringList(GetSubGroupLinksKey(groupKey)))
                {
                    var v = Storage.DecodeList(p).ToList();
                    if (v.Count != 2)
                    {
                        continue;
                    }

                    MenuLinkGroups.Add(new LinkGroupFilterable {
                        DisplayName = v[0],
                        GroupKey    = groupKey,
                        Source      = new Uri(v[1], UriKind.RelativeOrAbsolute)
                    });
                }
            }
        }
Example #16
0
        public MainWindow()
        {
            InitializeComponent();
            System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon();
            ni.Icon         = new System.Drawing.Icon("LOGO-ICON.ico");
            ni.Visible      = true;
            ni.DoubleClick +=
                delegate(object sender, EventArgs args)
            {
                this.Show();
                this.WindowState = WindowState.Normal;
            };

            ni.ContextMenuStrip = new System.Windows.Forms.ContextMenuStrip();
            ni.ContextMenuStrip.Items.Add("Show", null, (s, e) => {
                this.Show();
            });
            ni.ContextMenuStrip.Items.Add("Exit", null, (s, e) => {
                System.Diagnostics.Process.GetCurrentProcess().Kill();
            });


            Closing += (s, e) => {
                e.Cancel = true;
                this.Hide();
            };

            if (string.IsNullOrWhiteSpace(Properties.Settings.Default.Path))
            {
                MenuLinkGroups.Remove(uploadtab);
            }
            else
            {
                UploadTabAdded = true;
            }
        }
        internal void showLinks()
        {
            LinkGroup bib = new LinkGroup {
                DisplayName = "Bibliothèque"
            };

            bib.Links.Add(new Link {
                DisplayName = "Nos livres par rubrique", Source = new Uri("/pages/home/home.xaml", UriKind.RelativeOrAbsolute)
            });
            // bib.Links.Add(new Link { DisplayName = "Nos livres les plus consultés", Source = new Uri("/Content/MostConsulted.xaml", UriKind.RelativeOrAbsolute) });

            LinkGroup achat = new LinkGroup {
                DisplayName = "Service Achat"
            };

            achat.Links.Add(new Link {
                DisplayName = "Bienvenue", Source = new Uri("/pages/achat/Achat.xaml", UriKind.RelativeOrAbsolute)
            });

            MenuLinkGroups.Add(bib);
            MenuLinkGroups.Add(achat);

            ContentSource = bib.Links.First().Source;
        }
Example #18
0
        public MainWindow()
        {
            Owner = null;

            var app = Application.Current;

            if (app != null)
            {
                app.MainWindow = this;
            }

            _cancelled = false;

            if (_testGameDialog != null)
            {
                Logging.Write("Testing mode");
                var ui = new GameDialog();
                ui.ShowDialogAsync().Forget();
                ((IGameUi)ui).OnResult(JsonConvert.DeserializeObject <Game.Result>(FileUtils.ReadAllText(_testGameDialog)), null);
                _cancelled = true;
            }

            if (_cancelled)
            {
                Close();
                return;
            }

            InitializeSubGroups();

            var downloadsNavigateCommand = new NavigateCommand(this, new Uri("/Pages/Miscellaneous/DownloadsList.xaml", UriKind.Relative));

            DataContext = new ViewModel();
            InputBindings.AddRange(new[] {
                new InputBinding(new NavigateCommand(this, "drive"), new KeyGesture(Key.F1)),
                new InputBinding(new NavigateCommand(this, "lapTimes"), new KeyGesture(Key.F2)),
                new InputBinding(new NavigateCommand(this, "stats"), new KeyGesture(Key.F3)),
                new InputBinding(new NavigateCommand(this, "media"), new KeyGesture(Key.F4)),

                // Second group, Ctrl+F…
                new InputBinding(new NavigateCommand(this, new Uri("/Pages/Lists/CarsListPage.xaml", UriKind.Relative)),
                                 new KeyGesture(Key.F1, ModifierKeys.Control)),
                InternalUtils.IsAllRight ? new InputBinding(new NavigateCommand(this, new Uri("/Pages/Lists/ServerPresetsListPage.xaml", UriKind.Relative)),
                                                            new KeyGesture(Key.F2, ModifierKeys.Control)) : null,

                // Downloads hotkey
                new InputBinding(new DelegateCommand(() => {
                    if (AppAppearanceManager.Instance.DownloadsInSeparatePage)
                    {
                        downloadsNavigateCommand.Execute();
                    }
                    else
                    {
                        this.RequireChild <Popup>("DownloadsPopup").IsOpen = true;
                    }
                }), new KeyGesture(Key.J, ModifierKeys.Control)),

                // Settings, Alt+F…
                new InputBinding(new NavigateCommand(this, new Uri("/Pages/Settings/SettingsPage.xaml", UriKind.Relative)),
                                 new KeyGesture(Key.F1, ModifierKeys.Alt)),
                new InputBinding(new NavigateCommand(this, new Uri("/Pages/AcSettings/AcSettingsPage.xaml", UriKind.Relative)),
                                 new KeyGesture(Key.F2, ModifierKeys.Alt)),
                new InputBinding(new NavigateCommand(this, new Uri("/Pages/Settings/PythonAppsSettings.xaml", UriKind.Relative)),
                                 new KeyGesture(Key.F3, ModifierKeys.Alt)),
            }.NonNull().ToList());

            InitializeComponent();
            ModsWebBrowser.Instance.RebuildLinksNow();
            ArgumentsHandler.HandlePasteEvent(this);

            if (SteamStarter.IsInitialized)
            {
                OverlayContentCell.Children.Add((FrameworkElement)FindResource(@"SteamOverlayFix"));
            }

            LinkNavigator.Commands.Add(new Uri("cmd://enterKey"), Model.EnterKeyCommand);
            InternalUtils.Launch(this);

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.Source.OriginalString.Contains(@"/online.xaml", StringComparison.OrdinalIgnoreCase)))
            {
                result.LinkChanged += OnlineLinkChanged;
            }

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.Source.OriginalString.Contains(@"/laptimes_table.xaml", StringComparison.OrdinalIgnoreCase)))
            {
                result.LinkChanged += LapTimesLinkChanged;
            }

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.GroupKey == "media" || x.GroupKey == "content"))
            {
                result.LinkChanged += ContentLinkChanged;
            }

            UpdateLiveTabs();
            SettingsHolder.Live.PropertyChanged += OnLiveSettingsPropertyChanged;

            UpdateTitleLinks();
            AppAppearanceManager.Instance.PropertyChanged += OnAppAppearancePropertyChanged;

            UpdateMinoratingLink();
            SettingsHolder.Online.PropertyChanged += OnOnlineSettingsPropertyChanged;

            _defaultOnlineGroupCount = OnlineGroup.FixedLinks.Count;

            if (FileBasedOnlineSources.IsInitialized())
            {
                UpdateOnlineSourcesLinks();
            }

            FileBasedOnlineSources.Instance.Update += OnOnlineSourcesUpdate;

            Activated += OnActivated;

            if (SettingsHolder.Drive.SelectedStarterType != SettingsHolder.DriveSettings.SteamStarterType)
            {
                TitleLinks.Remove(OriginalLauncher);
            }
            else
            {
                LinkNavigator.Commands.Add(new Uri("cmd://originalLauncher"), new DelegateCommand(SteamStarter.StartOriginalLauncher));
            }

            ContentInstallationManager.Instance.TaskAdded += OnContentInstallationTaskAdded;
            UpdateDiscordRichPresence();

#if DEBUG
            LapTimesGrid.Source = new Uri("/Pages/Miscellaneous/LapTimes_Grid.xaml", UriKind.Relative);
#else
            // MenuLinkGroups.Remove(BrowserLinkGroup);
#endif
        }
Example #19
0
        private void setupMenu()
        {
            for (int i = 0; i < MenuLinkGroups.Count; i++)
            {
                if (MenuLinkGroups[i].GroupKey == "main")
                {
                    MenuLinkGroups.RemoveAt(i--);
                }
            }

            LinkGroup lkgp = new LinkGroup();

            lkgp.DisplayName = "首页";
            lkgp.GroupKey    = "main";
            lkgp.Links.Add(new Link {
                DisplayName = "欢迎页", Source = new Uri("/Views/MainPage.xaml", UriKind.RelativeOrAbsolute)
            });
            lkgp.Links.Add(new Link {
                DisplayName = "修改资料", Source = new Uri("/Views/UserData.xaml", UriKind.RelativeOrAbsolute)
            });
            MenuLinkGroups.Add(lkgp);

            if (DBHelper.currentUser.Group.SALEGOODS || DBHelper.currentUser.Group.RESTOCKGOODS || DBHelper.currentUser.Group.QUERYGOODS || DBHelper.currentUser.Group.EDITGOODS)
            {
                lkgp             = new LinkGroup();
                lkgp.DisplayName = "商品管理";
                lkgp.GroupKey    = "main";
                lkgp.Links.Add(new Link {
                    DisplayName = "库存概况", Source = new Uri("/Views/Goods/Summary.xaml", UriKind.RelativeOrAbsolute)
                });
                lkgp.Links.Add(new Link {
                    DisplayName = DBHelper.currentUser.Group.EDITGOODS ? "商品编辑" : "商品查询", Source = new Uri("/Views/Goods/QueryPage.xaml", UriKind.RelativeOrAbsolute)
                });
                if (DBHelper.currentUser.Group.RESTOCKGOODS)
                {
                    lkgp.Links.Add(new Link {
                        DisplayName = "进货", Source = new Uri("/Views/Goods/Restock.xaml", UriKind.RelativeOrAbsolute)
                    });
                }
                if (DBHelper.currentUser.Group.SALEGOODS)
                {
                    lkgp.Links.Add(new Link {
                        DisplayName = "销售", Source = new Uri("/Views/Goods/Sale.xaml", UriKind.RelativeOrAbsolute)
                    });
                }
                MenuLinkGroups.Add(lkgp);
            }
            if (DBHelper.currentUser.Group.EDITPERSONNEL || DBHelper.currentUser.Group.EDITGROUP)
            {
                lkgp             = new LinkGroup();
                lkgp.DisplayName = "人事管理";
                lkgp.GroupKey    = "main";
                if (DBHelper.currentUser.Group.EDITPERSONNEL)
                {
                    lkgp.Links.Add(new Link {
                        DisplayName = "人事管理", Source = new Uri("/Views/Personnel/User.xaml", UriKind.RelativeOrAbsolute)
                    });
                }
                if (DBHelper.currentUser.Group.EDITGROUP)
                {
                    lkgp.Links.Add(new Link {
                        DisplayName = "职位管理", Source = new Uri("/Views/Personnel/Group.xaml", UriKind.RelativeOrAbsolute)
                    });
                }
                MenuLinkGroups.Add(lkgp);
            }
            if (DBHelper.currentUser.Group.EDITLOG || DBHelper.currentUser.Group.QUERYLOG)
            {
                lkgp             = new LinkGroup();
                lkgp.DisplayName = "操作日志";
                lkgp.GroupKey    = "main";
                lkgp.Links.Add(new Link {
                    DisplayName = "日志", Source = new Uri("/Views/Log.xaml", UriKind.RelativeOrAbsolute)
                });
                MenuLinkGroups.Add(lkgp);
            }
        }
Example #20
0
        public MainWindow()
        {
            var app = Application.Current;

            if (app != null)
            {
                app.MainWindow = this;
            }

            _cancelled = false;

            if (AppArguments.Values.Any())
            {
                ProcessArguments();
            }

            if (_testGameDialog != null)
            {
                Logging.Write("Testing mode");
                var ui = new GameDialog();
                ui.ShowDialogWithoutBlocking();
                ((IGameUi)ui).OnResult(JsonConvert.DeserializeObject <Game.Result>(FileUtils.ReadAllText(_testGameDialog)), null);
                _cancelled = true;
            }

            if (_cancelled)
            {
                Close();
                return;
            }

            DataContext = new ViewModel();
            InputBindings.AddRange(new[] {
                new InputBinding(new NavigateCommand(this, "about"), new KeyGesture(Key.F1, ModifierKeys.Alt)),
                new InputBinding(new NavigateCommand(this, "settings"), new KeyGesture(Key.F1, ModifierKeys.Control)),
                new InputBinding(new NavigateCommand(this, "drive"), new KeyGesture(Key.F1)),
                new InputBinding(new NavigateCommand(this, "lapTimes"), new KeyGesture(Key.F2)),
                new InputBinding(new NavigateCommand(this, "stats"), new KeyGesture(Key.F3)),
                new InputBinding(new NavigateCommand(this, "media"), new KeyGesture(Key.F4))
            });
            InitializeComponent();

            LinkNavigator.Commands.Add(new Uri("cmd://enterkey"), Model.EnterKeyCommand);
            AppKeyHolder.ProceedMainWindow(this);

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.Source.OriginalString.Contains(@"/online.xaml", StringComparison.OrdinalIgnoreCase)))
            {
                result.LinkChanged += OnlineLinkChanged;
            }

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.GroupKey == "content"))
            {
                result.LinkChanged += ContentLinkChanged;
            }

            UpdateLiveTabs();
            SettingsHolder.Live.PropertyChanged += Live_PropertyChanged;

            UpdateServerTab();
            UpdateMinoratingLink();
            SettingsHolder.Online.PropertyChanged += Online_PropertyChanged;

            if (!OfficialStarterNotification() && PluginsManager.Instance.HasAnyNew())
            {
                Toast.Show("Don’t forget to install plugins!", ""); // TODO?
            }

            EntryPoint.HandleSecondInstanceMessages(this, HandleMessagesAsync);

            _defaultOnlineGroupCount = OnlineGroup.FixedLinks.Count;

            if (FileBasedOnlineSources.IsInitialized())
            {
                UpdateOnlineSourcesLinks();
            }
            FileBasedOnlineSources.Instance.Update += OnOnlineSourcesUpdate;

            Activated += OnActivated;

#if DEBUG
            LapTimesGrid.Source = new Uri("/Pages/Miscellaneous/LapTimes_Grid.xaml", UriKind.Relative);
#endif
        }
Example #21
0
        public MainWindow()
        {
            var app = Application.Current;

            if (app != null)
            {
                app.MainWindow = this;
            }

            _cancelled = false;

            if (_testGameDialog != null)
            {
                Logging.Write("Testing mode");
                var ui = new GameDialog();
                ui.ShowDialogWithoutBlocking();
                ((IGameUi)ui).OnResult(JsonConvert.DeserializeObject <Game.Result>(FileUtils.ReadAllText(_testGameDialog)), null);
                _cancelled = true;
            }

            if (_cancelled)
            {
                Close();
                return;
            }

            InitializeSubGroups();
            DataContext = new ViewModel();
            InputBindings.AddRange(new[] {
                new InputBinding(new NavigateCommand(this, "content"), new KeyGesture(Key.F1, ModifierKeys.Control)),
                new InputBinding(new NavigateCommand(this, "server"), new KeyGesture(Key.F2, ModifierKeys.Control)),
                new InputBinding(new NavigateCommand(this, "settings"), new KeyGesture(Key.F3, ModifierKeys.Control)),
                new InputBinding(new NavigateCommand(this, "about"), new KeyGesture(Key.F4, ModifierKeys.Control)),
                new InputBinding(new NavigateCommand(this, "drive"), new KeyGesture(Key.F1)),
                new InputBinding(new NavigateCommand(this, "lapTimes"), new KeyGesture(Key.F2)),
                new InputBinding(new NavigateCommand(this, "stats"), new KeyGesture(Key.F3)),
                new InputBinding(new NavigateCommand(this, "media"), new KeyGesture(Key.F4)),
                new InputBinding(new DelegateCommand(() => {
                    if (Keyboard.FocusedElement is TextBoxBase || Keyboard.FocusedElement is CheckBox)
                    {
                        return;
                    }

                    try {
                        if (Clipboard.ContainsData(DataFormats.FileDrop))
                        {
                            var data = Clipboard.GetFileDropList().OfType <string>().ToList();
                            Dispatcher.InvokeAsync(() => {
                                ProcessDroppedFiles(data);
                            });
                        }
                        else if (Clipboard.ContainsData(DataFormats.UnicodeText))
                        {
                            var list = Clipboard.GetText().SplitLines();
                            Dispatcher.InvokeAsync(() => {
                                ProcessDroppedFiles(list);
                            });
                        }
                    } catch (Exception e) {
                        Logging.Warning(e);
                    }
                }), new KeyGesture(Key.V, ModifierKeys.Control)),
            });
            InitializeComponent();

            LinkNavigator.Commands.Add(new Uri("cmd://enterkey"), Model.EnterKeyCommand);
            AppKeyHolder.ProceedMainWindow(this);

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.Source.OriginalString.Contains(@"/online.xaml", StringComparison.OrdinalIgnoreCase)))
            {
                result.LinkChanged += OnlineLinkChanged;
            }

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.Source.OriginalString.Contains(@"/laptimes_table.xaml", StringComparison.OrdinalIgnoreCase)))
            {
                result.LinkChanged += LapTimesLinkChanged;
            }

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.GroupKey == "media" || x.GroupKey == "content"))
            {
                result.LinkChanged += ContentLinkChanged;
            }

            UpdateLiveTabs();
            SettingsHolder.Live.PropertyChanged += OnLiveSettingsPropertyChanged;

            UpdateServerTab();
            UpdateMinoratingLink();
            SettingsHolder.Online.PropertyChanged += OnOnlineSettingsPropertyChanged;

            if (!OfficialStarterNotification() && PluginsManager.Instance.HasAnyNew())
            {
                Toast.Show("Don’t forget to install plugins!", ""); // TODO?
            }

            _defaultOnlineGroupCount = OnlineGroup.FixedLinks.Count;

            if (FileBasedOnlineSources.IsInitialized())
            {
                UpdateOnlineSourcesLinks();
            }

            FileBasedOnlineSources.Instance.Update += OnOnlineSourcesUpdate;

            Activated += OnActivated;

            if (SettingsHolder.Drive.SelectedStarterType != SettingsHolder.DriveSettings.SteamStarterType)
            {
                TitleLinks.Remove(OriginalLauncher);
            }
            else
            {
                LinkNavigator.Commands.Add(new Uri("cmd://originalLauncher"), new DelegateCommand(SteamStarter.StartOriginalLauncher));
            }

            ContentInstallationManager.PluginsNavigator = this;

#if DEBUG
            LapTimesGrid.Source = new Uri("/Pages/Miscellaneous/LapTimes_Grid.xaml", UriKind.Relative);
#endif
        }