Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        public MainWindow()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            InitializeComponent();
            LogoText.Text = @"    ____  _            ____                   _____________  ____
               / __ \(_)____      / __ )____  __  __     <  / ____/ __ \/ __ \
              / /_/ / / ___/_____/ __  / __ \/ / / /_____/ /___ \/ / / / / / /
             / ____/ / /__/_____/ /_/ / /_/ / /_/ /_____/ /___/ / /_/ / /_/ /
            /_/   /_/\___/     /_____/\____/\__, /     /_/_____/\____/\____/
                               /____/                             ";

            EventWorker = new EventWorker();
            Events = new ObservableCollection<Event>(EventWorker.GetAll());
            EventList.ItemsSource = Events;
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ManageEvent"/> class.
        /// </summary>
        /// <param name="events">Observable collection of events to work with.</param>
        public ManageEvent(ObservableCollection<Event> events)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            Events = events;
            EventWorker = new EventWorker();
            InitializeComponent();

            var currentTime = DateTime.Now;
            currentTime = currentTime.AddMilliseconds(-currentTime.Millisecond);

            if (ManagedEvent == null)
            {
                ManagedEvent = new Event
                {
                    Name = "",
                    DateBegin = currentTime.AddMinutes(15),
                    DateEnd = currentTime.EndOfDay()
                };
            }
        }