コード例 #1
0
        public SpaceportMenuController(
			SpaceportMenu menu, Control mainForm,
			Version version, EventRouter events,
			Settings settings, DeviceWatcher watcher)
        {
            this.mainForm = mainForm;
            this.settings = settings;
            this.watcher = watcher;

            menu.SelectTargets.Click += SelectTargets_Clicked;
            menu.About.Click += About_Clicked;
            menu.SpaceportWebsite.Click += SpaceportWebsite_Clicked;
        }
コード例 #2
0
        public UpdaterController(
			SpaceportMenu menu, Control mainForm,
			Version pluginVersion, Settings settings)
        {
            this.menu = menu;
            this.mainForm = mainForm;
            this.settings = settings;

            updaterPath = Path.Combine (PathHelper.DataDir, LOCAL_UPDATER_FILE);
            var remoteManifestUri = new Uri (REMOTE_MANIFEST_URI);
            var localUpdateCacheDir = Path.Combine (PathHelper.DataDir, LOCAL_UPDATECACHE_DIR);

            UpdateChecker = new UpdateChecker (remoteManifestUri, pluginVersion);
            UpdateDownloader = new UpdateDownloader (updaterPath, localUpdateCacheDir);
            LoadListeners();

            if (menu.CheckUpdates.Checked)
                UpdateChecker.Start();
        }
コード例 #3
0
ファイル: LaunchPad.cs プロジェクト: NullSoldier/Launchpad
        public void Initialize()
        {
            AppDomain.CurrentDomain.UnhandledException += (s, e) => {
                var ex = e.ExceptionObject as Exception;
                logger.Fatal (ex.Message, ex);
            };

            EventManager.AddEventHandler (this, EventType.Command);
            Log4NetHelper.ConfigureFromXML (Resources.log4net);
            SubDataEvent (SPPluginEvents.Enabled, OnPluginEnabled);
            SubDataEvent (SPPluginEvents.Disabled, OnPluginDisabled);
            SubDataEvent (ProjectManagerEvents.Project, OnProjectChanged);
            LoadSettings();

            logger = LogManager.GetLogger (typeof (Launchpad));
            version = Assembly.GetExecutingAssembly ().GetName ().Version;
            A = new Analytics (version);
            sp = new SPWrapper (LaunchpadPaths.SpaceportPath);
            watcher = new DeviceWatcher (sp);

            var mainForm = PluginBase.MainForm.MenuStrip.Parent.Parent;
            var menu = new SpaceportMenu (PluginBase.MainForm.MenuStrip);

            pc = new ProjectMenuController (this, sp, settings);
            uc = new UpdaterController (menu, mainForm, version, settings);
            spc = new SpaceportMenuController (menu, mainForm, version,
                this, settings, watcher);

            DeployListener.Listen (this, sp, settings, watcher);
            InstallListener.Listen (this, sp, settings);

            A.OnStarted();
        }