Esempio n. 1
0
        private void Initialise(IHelper aHelper, IViewAutoUpdate aView, IInvoker aInvoker, EventHandler <EventArgs> aUpdateStarted)
        {
            // create the auto updater
            // set it to look for stable releases to start with
            // option page will event what releases to look for once saved option has been parsed
            iAutoUpdate = new AutoUpdate(aHelper, AutoUpdate.kDefaultFeedLocation, 1000 * 60 * 60, AutoUpdate.EUpdateType.Stable, 1);

            // create the option page
            iOptionPageUpdates = new OptionPageUpdates(aHelper);
            iOptionPageUpdates.EventChanged += OptionPageUpdatesChanged;
            aHelper.AddOptionPage(iOptionPageUpdates);

            // create the controller
            iAutoUpdateController = new AutoUpdateController(aHelper, iAutoUpdate, iOptionPageUpdates, aView, aInvoker);
            iAutoUpdateController.EventUpdateStarted += aUpdateStarted;
        }
Esempio n. 2
0
        private void ApplicationStartup(object sender, StartupEventArgs e)
        {
            // this prevents the UI framework from handling unhandled exceptions so that they are let throught
            // to be handled by the Linn code
            System.Windows.Forms.Application.SetUnhandledExceptionMode(System.Windows.Forms.UnhandledExceptionMode.ThrowException);

            // create the app helper
            iHelper = new Helper(Environment.GetCommandLineArgs());
            OptionPagePrivacy optionPagePrivacy = new OptionPagePrivacy(iHelper);

            iHelper.AddOptionPage(optionPagePrivacy);
            iHelper.ProcessOptionsFileAndCommandLine();

            // create crash log dumper
            ICrashLogDumper d = new CrashLogDumperWindow(Songbox.Properties.Resources.Icon, iHelper.Title, iHelper.Product, iHelper.Version);

            iHelper.AddCrashLogDumper(d);

            // create view and helper for auto updates
            iViewAutoUpdate = new Toolkit.Wpf.ViewAutoUpdateStandard(Songbox.Properties.Resources.Icon, Songbox.Properties.Resources.Image106x106);
            iViewAutoUpdate.EventButtonUpdateClicked += EventButtonUpdateClicked;
            iHelperAutoUpdate = new HelperAutoUpdate(iHelper, iViewAutoUpdate, new Invoker(this.Dispatcher));
            iHelperAutoUpdate.OptionPageUpdates.BetaVersions = iHelper.BuildType == EBuildType.Beta;
            iHelperAutoUpdate.Start();

            iPageMain = new Linn.Songbox.PageMain(iHelper, optionPagePrivacy, iHelperAutoUpdate, new StartAtLoginOption(iHelper.Title));

            IconInfo iconInfo = new IconInfo("logo.png", "image/png", 106, 106, 32);

            try
            {
                // create the media server
                iServer = new Server("git://github.com/linnoss/MediaApps.git", iHelper.Company, "http://www.linn.co.uk", iHelper.Title, "http://www.linn.co.uk", new Presentation(iPageMain), iconInfo);
            }
            catch (ApplicationException)
            {
                Shutdown(-1);
            }

            // create the configuration window
            iWindow          = new ConfigurationWindow(Songbox.Properties.Resources.Icon, iHelper.Title, iServer);
            iWindow.Closing += EventWindowClosing;

            // create and show the sys tray icon
            iFormSysTray = new FormSysTray(this);
        }
Esempio n. 3
0
        public AutoUpdateController(IHelper aHelper, AutoUpdate aAutoUpdate, OptionPageUpdates aOptionPageUpdates, IViewAutoUpdate aView, IInvoker aInvoker)
        {
            iAutoUpdate        = aAutoUpdate;
            iOptionPageUpdates = aOptionPageUpdates;
            iView    = aView;
            iInvoker = aInvoker;

            iModel = new AutoUpdateModel(aHelper.Title);

            iAutoUpdate.EventUpdateProgress += UpdateProgress;
            iAutoUpdate.EventUpdateFailed   += UpdateFailed;
            iAutoUpdate.EventUpdateFound    += UpdateFound;

            iOptionPageUpdates.EventAutoUpdateChanged += AutoUpdateChanged;

            iView.EventClosed += ViewClosed;
            iView.EventButtonUpdateClicked    += ButtonUpdateClicked;
            iView.EventButtonAutoCheckClicked += ButtonAutoCheckClicked;

            AutoUpdateChanged(this, EventArgs.Empty);
        }
Esempio n. 4
0
 public HelperAutoUpdate(IHelper aHelper, IViewAutoUpdate aView, IInvoker aInvoker)
 {
     Initialise(aHelper, aView, aInvoker, this.UpdateStarted);
 }
Esempio n. 5
0
 public HelperAutoUpdate(IHelper aHelper, IViewAutoUpdate aView, IInvoker aInvoker, EventHandler <EventArgs> aUpdateStarted)
 {
     Initialise(aHelper, aView, aInvoker, aUpdateStarted);
 }