Exemplo n.º 1
0
        /// <summary>
        /// 表示を行う
        /// </summary>
        /// <param name="RetInfo"></param>
        /// <param name="mainWindow"></param>
        internal void Display(Queue<Member> RetInfo, MainWindow mainWindow)
        {
            //割り振り結果を出力する
            System.Diagnostics.Debug.WriteLine(RetInfo);
            int?[] day1 = new int?[ContractConst.PLACE_COUNT + 1];
            int?[] day2 = new int?[ContractConst.PLACE_COUNT + 1];
            int?[] day3 = new int?[ContractConst.PLACE_COUNT + 1];
            int?[] day4 = new int?[ContractConst.PLACE_COUNT + 1];
            int?[] day5 = new int?[ContractConst.PLACE_COUNT + 1];
            day1 = GetDayRowVal(RetInfo, ContractConst.DAYS.月);
            day2 = GetDayRowVal(RetInfo, ContractConst.DAYS.火);
            day3 = GetDayRowVal(RetInfo, ContractConst.DAYS.水);
            day4 = GetDayRowVal(RetInfo, ContractConst.DAYS.木);
            day5 = GetDayRowVal(RetInfo, ContractConst.DAYS.金);

            var data = new ObservableCollection<SojiPlace>(
                Enumerable.Range(1, ContractConst.PLACE_COUNT).Select(j => new SojiPlace
                {
                    m_placeId = ContractConst.PID[j - 1],
                    m_place = ContractConst.PLACE[j - 1],
                    m_afflictionDegree = ContractConst.COEFFICIENT[j],
                    m_day1 = day1[j],
                    m_day2 = day2[j],
                    m_day3 = day3[j],
                    m_day4 = day4[j],
                    m_day5 = day5[j],
                    m_day1_Color = day1[j] == null ? true : false,
                    m_day2_Color = day2[j] == null ? true : false,
                    m_day3_Color = day3[j] == null ? true : false,
                    m_day4_Color = day4[j] == null ? true : false,
                    m_day5_Color = day5[j] == null ? true : false
                }));
            mainWindow.targetGrid.ItemsSource = data;

            //得点を左ウィンドウに反映
            DataOption option = new DataOption();
            mainWindow.inDataGrid.ItemsSource = option.CreateScoreObject(RetInfo);
        }