Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();

            BrowserControl.LinkClicked += HtmlPanel_LinkClicked;

            _notifier = new Notifier(cfg =>
            {
                //place the notifications approximately inside the main editing area
                //(not over the toolbar area) on the top-right hand side
                cfg.PositionProvider = new WindowPositionProvider(
                    parentWindow: Application.Current.MainWindow,
                    corner: Corner.TopRight,
                    offsetX: 15,
                    offsetY: 90);

                cfg.LifetimeSupervisor = new TimeAndCountBasedLifetimeSupervisor(
                    notificationLifetime: TimeSpan.FromSeconds(5),
                    maximumNotificationCount: MaximumNotificationCount.FromCount(5));

                cfg.Dispatcher = Application.Current.Dispatcher;
            });

            _urlsByHash      = new Dictionary <string, string>();
            _bookmarkManager = new BookmarkManager(this, BrowserControl);

            AppInit.UpgradeSettings();
            AppInit.CopyAssets();

            _bookmarkManager.RefreshBookmarkMenu();

            var launchUri = _settings.HomeUrl;

            string[] args = App.Args;
            if (args != null)
            {
                launchUri = App.Args[0];
            }

            Navigate(launchUri);

            BuildThemeMenu();
            TickSelectedThemeMenu();
        }