예제 #1
0
파일: ViewData.cs 프로젝트: Hagser/csharp
        public void UpdateList(worldLeaderboardEvents _wle, List<worldLeaderboards> _wllist)
        {
            wle = _wle;
            wllist = _wllist;
            IEqualityComparer<worldDriverProfile> wdpc = new worldDriverProfileComparer();
            IEqualityComparer<worldCars> wcc = new worldCarsComparer();

            var plist = new List<string>();
            foreach (string str in personas.CheckedItems)
            {
                plist.Add(str);
            }
            personas.Tag = plist;
            var elist = new List<string>();
            foreach (string str in events.CheckedItems)
            {
                elist.Add(str);
            }
            events.Tag = elist;
            var emlist = new List<string>();
            foreach (string str in eventmodes.CheckedItems)
            {
                emlist.Add(str);
            }
            eventmodes.Tag = emlist;
            var clist = new List<string>();
            foreach (string str in cars.CheckedItems)
            {
                clist.Add(str);
            }
            cars.Tag = clist;

            personas.Items.Clear();
            events.Items.Clear();
            eventmodes.Items.Clear();
            cars.Items.Clear();

            personas.Items.AddRange(wllist.Select(x => x.persona.DriverProfile).Distinct(wdpc).OrderBy(x => x.name).Select(x => x.name).ToArray<string>());
            events.Items.AddRange(wle.Events.OrderBy(x => x.eventName).Select(x => x.eventName).ToArray<string>());
            eventmodes.Items.AddRange(wle.Events.Select(x => getEventModeName(x.eventModeId)).Distinct().ToArray<string>());
            cars.Items.AddRange(wllist.Select(x => x.car).Distinct(wcc).OrderBy(x => (x.make + " " + x.carName)).Select(x => (x.make + " " + x.carName)).ToArray<string>());

            var arr = new[] { personas, events, eventmodes, cars };
            foreach (CheckedListBox o in arr)
            {
                for (int i = 0; i < o.Items.Count; i++)
                {
                    o.SetItemChecked(i, (o.Tag as List<string>).Contains(o.Items[i]));
                }
            }
            
            
            //fromDate.Value = wllist.Min(x => x.createdDate.dateTime).Date;
            //toDate.Value = wllist.Max(x => x.createdDate.dateTime).Date;

            dataGridView1.DataSource = getFilteredList();
        }
예제 #2
0
파일: Form1.cs 프로젝트: bangush/csharp
 private void loadFromXml()
 {
     if (File.Exists(strDownloadPath + "\\worldleaderboardevents.xml"))
     {
         string xml = File.ReadAllText(strDownloadPath + "\\worldleaderboardevents.xml");
         wle = (SeDes.ToObj(xml, wle) as worldLeaderboardEvents);
     }
     else
     {
         wle.Events = new List <Event>();
     }
     twle.Events = new List <Event>();
     if (File.Exists(strDownloadPath + "\\worldleaderboardlist.xml"))
     {
         string xml = File.ReadAllText(strDownloadPath + "\\worldleaderboardlist.xml");
         wllist = (SeDes.ToObj(xml, wllist) as List <worldLeaderboards>);
     }
     if (File.Exists(strDownloadPath + "\\drivers.xml"))
     {
         string xml = File.ReadAllText(strDownloadPath + "\\drivers.xml");
         drivers = (SeDes.ToObj(xml, drivers) as List <Driver>);
     }
 }
예제 #3
0
파일: ViewEvents.cs 프로젝트: Hagser/csharp
 public ViewEvents(worldLeaderboardEvents _wle,worldLeaderboardEvents _twle)
 {
     InitializeComponent();
     wle = _wle;
     twle = _twle;
 }
예제 #4
0
파일: EventArgs.cs 프로젝트: bangush/csharp
 public ListChangeEventArgs(worldLeaderboardEvents _wle, List <worldLeaderboards> _wllist, List <Driver> _drivers)
 {
     wle     = _wle;
     wllist  = _wllist;
     drivers = _drivers;
 }
예제 #5
0
파일: ViewData.cs 프로젝트: bangush/csharp
        public void UpdateList(worldLeaderboardEvents _wle, List <worldLeaderboards> _wllist)
        {
            wle    = _wle;
            wllist = _wllist;
            IEqualityComparer <worldDriverProfile> wdpc = new worldDriverProfileComparer();
            IEqualityComparer <worldCars>          wcc  = new worldCarsComparer();

            var plist = new List <string>();

            foreach (string str in personas.CheckedItems)
            {
                plist.Add(str);
            }
            personas.Tag = plist;
            var elist = new List <string>();

            foreach (string str in events.CheckedItems)
            {
                elist.Add(str);
            }
            events.Tag = elist;
            var emlist = new List <string>();

            foreach (string str in eventmodes.CheckedItems)
            {
                emlist.Add(str);
            }
            eventmodes.Tag = emlist;
            var clist = new List <string>();

            foreach (string str in cars.CheckedItems)
            {
                clist.Add(str);
            }
            cars.Tag = clist;

            personas.Items.Clear();
            events.Items.Clear();
            eventmodes.Items.Clear();
            cars.Items.Clear();

            personas.Items.AddRange(wllist.Select(x => x.persona.DriverProfile).Distinct(wdpc).OrderBy(x => x.name).Select(x => x.name).ToArray <string>());
            events.Items.AddRange(wle.Events.OrderBy(x => x.eventName).Select(x => x.eventName).ToArray <string>());
            eventmodes.Items.AddRange(wle.Events.Select(x => getEventModeName(x.eventModeId)).Distinct().ToArray <string>());
            cars.Items.AddRange(wllist.Select(x => x.car).Distinct(wcc).OrderBy(x => (x.make + " " + x.carName)).Select(x => (x.make + " " + x.carName)).ToArray <string>());

            var arr = new[] { personas, events, eventmodes, cars };

            foreach (CheckedListBox o in arr)
            {
                for (int i = 0; i < o.Items.Count; i++)
                {
                    o.SetItemChecked(i, (o.Tag as List <string>).Contains(o.Items[i]));
                }
            }


            //fromDate.Value = wllist.Min(x => x.createdDate.dateTime).Date;
            //toDate.Value = wllist.Max(x => x.createdDate.dateTime).Date;

            dataGridView1.DataSource = getFilteredList();
        }
예제 #6
0
파일: ViewData.cs 프로젝트: bangush/csharp
 public ViewData(worldLeaderboardEvents _wle, List <worldLeaderboards> _wllist)
 {
     InitializeComponent();
     wle    = _wle;
     wllist = _wllist;
 }
예제 #7
0
파일: ViewData.cs 프로젝트: Hagser/csharp
 public ViewData(worldLeaderboardEvents _wle, List<worldLeaderboards> _wllist)
 {
     InitializeComponent();
     wle = _wle;
     wllist = _wllist;
 }
예제 #8
0
파일: Form1.cs 프로젝트: Hagser/csharp
 private void loadFromXml()
 {
     if (File.Exists(strDownloadPath + "\\worldleaderboardevents.xml"))
     {
         string xml = File.ReadAllText(strDownloadPath + "\\worldleaderboardevents.xml");
         wle = (SeDes.ToObj(xml, wle) as worldLeaderboardEvents);
     }
     else
     {
         wle.Events = new List<Event>();
     }
     twle.Events = new List<Event>();
     if (File.Exists(strDownloadPath + "\\worldleaderboardlist.xml"))
     {
         string xml = File.ReadAllText(strDownloadPath + "\\worldleaderboardlist.xml");
         wllist = (SeDes.ToObj(xml, wllist) as List<worldLeaderboards>);
     }
     if (File.Exists(strDownloadPath + "\\drivers.xml"))
     {
         string xml = File.ReadAllText(strDownloadPath + "\\drivers.xml");
         drivers = (SeDes.ToObj(xml, drivers) as List<Driver>);
     }
 }
예제 #9
0
 public ViewEvents(worldLeaderboardEvents _wle, worldLeaderboardEvents _twle)
 {
     InitializeComponent();
     wle  = _wle;
     twle = _twle;
 }
예제 #10
0
파일: EventArgs.cs 프로젝트: Hagser/csharp
 public ListChangeEventArgs(worldLeaderboardEvents _wle, List<worldLeaderboards> _wllist,List<Driver> _drivers)
 {
     wle = _wle;
     wllist = _wllist;
     drivers = _drivers;
 }