void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.CommunityEventsWindow1 = ((EventDisplay.CommunityEventsWindow)(target));
                return;

            case 2:
                this.CEWTodaysEventsTB = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.CEWDateTB = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.CEWCloseWindow = ((System.Windows.Controls.Button)(target));

            #line 40 "..\..\CommunityEventsWindow.xaml"
                this.CEWCloseWindow.Click += new System.Windows.RoutedEventHandler(this.CEWCloseWindow_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.CEWListView = ((System.Windows.Controls.ListView)(target));
                return;
            }
            this._contentLoaded = true;
        }
Esempio n. 2
0
        private void CommunityRoomEvents_Click(object sender, RoutedEventArgs e)
        {
            CommunityEventsWindow cew = new CommunityEventsWindow();

            List <EventDetails> AdultPrograms    = new List <EventDetails>();
            List <EventDetails> TeenPrograms     = new List <EventDetails>();
            List <EventDetails> ChildrenPrograms = new List <EventDetails>();

            string todaysDateString = DateTime.Today.ToString("MMMM d, yyyy");

            //string todaysDateString = DateTime.Today.ToString("April 12, 2019");
            cew.CEWDateTB.Text = todaysDateString;

            foreach (EventDetails ev in eventList)
            {
                if (ev.Name.Contains("&#039;"))
                {
                    ev.Name = ev.Name.Replace("&#039;", "'");
                }

                if (ev.Name.Contains("&amp;"))
                {
                    ev.Name = ev.Name.Replace("&amp;", "&");
                }

                if (ev.Name.Contains("&quot;"))
                {
                    ev.Name = ev.Name.Replace("&quot;", "\"");
                }

                if (ev.AgeRange == "Adult" && ev.Date == todaysDateString && ev.Room == "Community Room")
                {
                    AdultPrograms.Add(ev);
                }

                if (ev.AgeRange == "Teen" && ev.Date == todaysDateString && ev.Room == "Community Room")
                {
                    TeenPrograms.Add(ev);
                }

                if (ev.AgeRange == "School Age" || ev.AgeRange == "Infant/Toddler/Preschool" || ev.AgeRange == "Family" || ev.AgeRange == "Infant/Toddler/Preschool, School Age, Family")
                {
                    if (ev.Date == todaysDateString && ev.Room == "Community Room")
                    {
                        ChildrenPrograms.Add(ev);
                    }
                }
            }

            ListViewHeaders childHeader = new ListViewHeaders
            {
                Time = "Time",
                Name = "Children's Programs",
                Room = "Location"
            };

            ListViewHeaders teenHeader = new ListViewHeaders
            {
                Time = "Time",
                Name = "Teen Programs",
                Room = "Location"
            };

            ListViewHeaders adultHeader = new ListViewHeaders
            {
                Time = "Time",
                Name = "Adult Programs",
                Room = "Location"
            };

            ListViewHeaders blankLine = new ListViewHeaders();



            if (ChildrenPrograms.Count != 0)
            {
                cew.CEWListView.Items.Add(childHeader);
                foreach (EventDetails ev in ChildrenPrograms)
                {
                    if (ev.Date == todaysDateString && ev.Room == "Community Room")
                    {
                        cew.CEWListView.Items.Add(ev);
                    }
                }
                cew.CEWListView.Items.Add(blankLine);
            }

            if (TeenPrograms.Count != 0)
            {
                cew.CEWListView.Items.Add(teenHeader);
                foreach (EventDetails ev in TeenPrograms)
                {
                    if (ev.Date == todaysDateString && ev.Room == "Community Room")
                    {
                        cew.CEWListView.Items.Add(ev);
                    }
                }
                cew.CEWListView.Items.Add(blankLine);
            }

            if (AdultPrograms.Count != 0)
            {
                cew.CEWListView.Items.Add(adultHeader);
                foreach (EventDetails ev in AdultPrograms)
                {
                    if (ev.Date == todaysDateString && ev.Room == "Community Room")
                    {
                        cew.CEWListView.Items.Add(ev);
                    }
                }
                cew.CEWListView.Items.Add(blankLine);
            }

            cew.Show();
        }