Exemple #1
0
        public SplashWnd()
        {
            _initializationComplete = false;
            _timer          = new Timer();
            _timer.Interval = 500;
            _startingTick   = Environment.TickCount;
            _timer.Tick    += timer_Tick;
            _timer.Enabled  = true;

            InitializeComponent();

            _titleLabel.Text     = AssemblyAttributes.Title;
            _authorLabel.Text    = $"by {AssemblyAttributes.Company}";
            _versionLabel.Text   = AssemblyAttributes.Version;
            _copyrightLabel.Text = AssemblyAttributes.Copyright;

            _controls = new ManageIntervalWnd();

            _tray     = new TrayIconWnd(_trayIcon, _controls);
            _settings = new SettingsManager();

            _settings.InitializeFromSqlitePath(getStoragePath(), "debug.private");
            _clock = new IntervalManager(_settings);

            _plugins = new PluginManager();
            if (!_plugins.Initialize(_clock, _tray, _controls))
            {
                Application.Exit();
            }
            else
            {
                _initializationComplete = true;
            }
        }
Exemple #2
0
        public TrayIconWnd(NotifyIcon icon, ManageIntervalWnd controls)
        {
            _icon     = icon;
            _controls = controls;

            _stateMenuItem = new MenuItem("[error]", new EventHandler(handleStateMenu));
            MenuItem configMenuItem = new MenuItem("Configuration", new EventHandler(handleConfigMenu));
            MenuItem helpMenuItem   = new MenuItem("Help", new EventHandler(handleHelpMenu));
            MenuItem exitMenuItem   = new MenuItem("Exit", new EventHandler(handleExitMenu));

            _icon.ContextMenu = new ContextMenu(new MenuItem[]
            {
                _stateMenuItem,
                new MenuItem("-"),
                helpMenuItem,
                configMenuItem,
                exitMenuItem
            });

            _icon.BalloonTipClicked += icon_OnNormalClick;
            _icon.MouseDown         += icon_OnMouseDown;

            RefreshForState(null);
        }