public MainWindow()
        {
            close = false;

            contextMenu = new ContextMenu();
            menuItem1   = new MenuItem
            {
                Index = 0,
                Text  = "Exit"
            };
            menuItem1.Click += new EventHandler(OnQuitClick);

            contextMenu.MenuItems.AddRange(new MenuItem[]
            {
                menuItem1
            });

            notifyIcon = new NotifyIcon
            {
                Icon        = Properties.Resources.ClockIcon,
                Text        = "Clock In Notifier",
                ContextMenu = contextMenu,
                Visible     = false
            };
            notifyIcon.MouseDoubleClick  += new MouseEventHandler(OnNotifyIconClick);
            notifyIcon.BalloonTipClicked += new EventHandler(OnBalloonTipClick);

            displayDate   = DateTime.Now;
            dataComponent = new DataComponent()
            {
                HourDisplay = displayDate.ToShortTimeString()
            };

            DataContext = dataComponent;

            InitializeComponent();

            cbShiftTime.SelectedIndex = 1;
            UpdateShiftTime(null, null);
        }
        private void AddHourRestry(object sender, RoutedEventArgs e)
        {
            if (!CanAddNewResgitry())
            {
                System.Windows.MessageBox.Show
                (
                    invalidErrorMessage,
                    "Invalid Operation Error",
                    MessageBoxButton.OK,
                    MessageBoxImage.Error
                );
                return;
            }

            var newItem = new DataComponent()
            {
                HourDisplay = HourTextBlock.Text
            };

            ListView.Items.Add(newItem);
            CalculateTimeToLeave();
        }