예제 #1
0
        public frmMain(cMainController newController)
        {
            InitializeComponent();
            this.MainController = newController;

            //Timer for updating the shown times
            MyTimer          = new DispatcherTimer();
            MyTimer.Tick    += new EventHandler(MyTimer_Tick);
            MyTimer.Interval = new TimeSpan(0, 0, 1);
            MyTimer.Start();

            //Defaultvalue for the next possible Alarm is now + 1 Minute. //TODO: Prüfen ob bei Minute 1 bis 9 eine führende 0 angezeigt weird.:
            txtAlarmTime.Text = DateTime.Now.Hour.ToString("00.##") + ":" + (DateTime.Now.Minute + 1).ToString("00.##");

            //Starting the programm no Alarm Exists, so the AlarmClocks should be invisible
            setAlarmClocksVisibility(false);

            //ADDED
            //++++++++++++++
            System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon();
            ni.Icon         = new System.Drawing.Icon(@"C:\Users\mrommel\Documents\VisualStudioProjekte\CS_Schulgong\CS_Schulgong\Resources\LKTools.ico");
            ni.Visible      = true;
            ni.DoubleClick +=
                delegate(object sender, EventArgs args)
            {
                this.Show();
                this.WindowState = WindowState.Normal;
            };

            //ADDED
            //++++++++++++++

            this.Show();
        }
예제 #2
0
 public App()
 {
     this.MainController = new cMainController();
     this.MainWindow     = new frmMain(this.MainController);
     this.MainController.registriereForm(this.MainWindow);
 }