Exemple #1
0
        /// <summary>
        /// カレンダーを変更するイベント
        /// </summary>
        /// <param name="sender">呼び出し元のクラス</param>
        /// <param name="e">イベント情報</param>
        private void WeekChange(object sender, CalenderEventArgs e)
        {
            // 曜日タイトルの作成
            int dateCol = 0;

            if (!e.Option.IsDatePrintChange)
            {
                dateCol = 6;
            }

            var sun = new WeekTitleSun()
            {
                Col = dateCol,
            };

            this.CalenderWeekItems[0] = sun;
            dateCol++;

            if (dateCol > 6)
            {
                dateCol = 0;
            }

            var mon = new WeekTitleMon()
            {
                Col = dateCol,
            };

            this.CalenderWeekItems[1] = mon;
            dateCol++;

            var tue = new WeekTitleTue()
            {
                Col = dateCol,
            };

            this.CalenderWeekItems[2] = tue;
            dateCol++;

            var wen = new WeekTitleWen()
            {
                Col = dateCol,
            };

            this.CalenderWeekItems[3] = wen;
            dateCol++;

            var thu = new WeekTitleThu()
            {
                Col = dateCol,
            };

            this.CalenderWeekItems[4] = thu;
            dateCol++;

            var fri = new WeekTitleFri()
            {
                Col = dateCol,
            };

            this.CalenderWeekItems[5] = fri;
            dateCol++;

            var sat = new WeekTitleSat()
            {
                Col = dateCol,
            };

            this.CalenderWeekItems[6] = sat;
        }
        /// <summary>
        /// カレンダーを1つ作成するメソッド
        /// </summary>
        /// <param name="calData">カレンダーデータクラス</param>
        /// <param name="paramOption">オプションクラス</param>
        /// <returns>CalenderEntity カレンダーの情報</returns>
        protected CalenderCreateEntity SetCalender(CalenderData calData, Option paramOption)
        {
            // 日付データの作成
            this.entity         = new CalenderCreateEntity();
            this.sunColorNumber = 0;
            this.satColorNumber = 6;

            calData.LastDay();
            calData.FastDateCreate();
            this.entity.Date        = calData.Date;
            this.entity.StringMonth = calData.Date.Month.ToString();
            this.entity.StringYear  = calData.Date.Year.ToString();
            this.option             = paramOption;

            var col = this.DateSwitch(this.option.IsDatePrintChange, calData.FastDate);

            var row = 0;

            this.DaysCreate(this.entity, calData, col, row, this.option);

            // 曜日の作成
            var dateCol = 0;
            var sun     = new WeekTitleSun()
            {
                Col = dateCol,
            };

            this.entity.CalenderWeekItems.Add(sun);
            dateCol++;

            var mon = new WeekTitleMon()
            {
                Col = dateCol,
            };

            this.entity.CalenderWeekItems.Add(mon);
            dateCol++;

            var tue = new WeekTitleTue()
            {
                Col = dateCol,
            };

            this.entity.CalenderWeekItems.Add(tue);
            dateCol++;

            var wen = new WeekTitleWen()
            {
                Col = dateCol,
            };

            this.entity.CalenderWeekItems.Add(wen);
            dateCol++;

            var thu = new WeekTitleThu()
            {
                Col = dateCol,
            };

            this.entity.CalenderWeekItems.Add(thu);
            dateCol++;

            var fri = new WeekTitleFri()
            {
                Col = dateCol,
            };

            this.entity.CalenderWeekItems.Add(fri);
            dateCol++;

            var sat = new WeekTitleSat()
            {
                Col = dateCol,
            };

            this.entity.CalenderWeekItems.Add(sat);

            return(this.entity);
        }