Пример #1
0
        public TickTrayForm()
        {
            this.Visible = false;
            this.Icon    = resources.stock_lock_32;

            trayMenu = new ContextMenu();
            trayMenu.MenuItems.Add("Neustarten", OnReload);
            trayMenu.MenuItems.Add("Zeitbegrenzung einrichten...", OnEdit);
            trayMenu.MenuItems.Add("Aktuellen Verbrauch anzeigen...", OnView);
            trayMenu.MenuItems.Add("-");
            trayMenu.MenuItems.Add("Beenden", OnExit);

            trayIcon             = new NotifyIcon();
            trayIcon.Icon        = resources.stock_lock_16;
            trayIcon.MouseClick += ShowBallonInfo;
            //trayIcon.MouseMove += ShowBallonInfo;
            trayIcon.ContextMenu = trayMenu;
            trayIcon.Visible     = true;

            configuration = TickConfiguration.Instance;
            dataFile      = new TickDataFile(configuration.DataFile);

            timer          = new Timer();
            timer.Enabled  = true;
            timer.Interval = TIMER_INTERVAL;
            timer.Tick    += HandleTimerTick;
        }
Пример #2
0
        public Viewer(TickConfiguration configuration, TickDataFile dataFile)
        {
            this.configuration = configuration;
            this.dataFile      = dataFile;
            this.Icon          = resources.stock_lock_32;
            this.Size          = new Size(600, 400);
            this.MinimumSize   = new Size(400, 300);
            this.Text          = "Zeitbegrenzung";

            createUI();
            loadData();
        }
Пример #3
0
 public TickJob(int interval, string dataFileName)
 {
     this.interval = interval;
     dataFile      = new TickDataFile(dataFileName);
 }