Esempio n. 1
0
        /// <summary>
        /// フォームのコントロールをセットアップする
        /// </summary>
        private void ControlsSetup()
        {
            this.Text = Program.AssemblyName;

            this.Size = new Size( 1090, 600 );

            this.FormClosing += ( obj, e )=> {
                this.setting_.MainFormSetting = this.ToSetting();
                this.UpdateUMAListViewSetting();

                WP7_2012ULV.Setting.ProgramSetting.SaveToFile( this.setting_, Program.SettingFileName );
            };

            this.Shown += ( obj, e )=> {
                if( this.setting_.MainFormSetting != null ) {
                    this.Location = new Point( this.setting_.MainFormSetting.Left, this.setting_.MainFormSetting.Top );
                }
                this.timer1.Tick += ( _obj, _e )=> {
                    Invoke( (MethodInvoker)delegate {
                        this.toolStripStatusLabel1.Text = String.Format( "{0:f2}(MB)", GC.GetTotalMemory( false ) / 1024.0 / 1024.0 );
                    });
                };
                this.timer1.Interval = 1000;
                this.timer1.Start();
            };

            this.pictureBox1.Top = 3;
            this.pictureBox1.Left = this.tabControl1.TabCount * 90 + 5;

            this.tabControl1.SelectedIndexChanged += this.tabControl1_SelectedIndexChangedHandler;

            this.tabPage1.Tag = Enums.HorseType.RACE;
            this.tabPage2.Tag = Enums.HorseType.CHILD;
            this.tabPage3.Tag = Enums.HorseType.DAM;
            this.tabPage4.Tag = Enums.HorseType.SIRE;

            this.checkBox1.Checked = true;
            this.checkBox2.Checked = true;
            this.checkBox3.Checked = true;
            this.checkBox4.Checked = true;
            this.checkBox5.Checked = true;
            this.checkBox6.Checked = true;
            this.checkBox7.Checked = true;
            this.checkBox8.Checked = true;
            this.checkBox9.Checked = true;
            this.checkBox10.Checked = false;
            this.checkBox11.Checked = false;
            this.checkBox12.Checked = false;
            this.checkBox13.Checked = false;

            this.checkBox1.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.Age_0 = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox2.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.Age_1 = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox3.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.Age_2 = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox4.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.Age_3 = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox5.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.Age_ETC = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox6.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.Country_JAPAN = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox7.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.Country_USA = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox8.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.Country_EURO = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox9.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.Status_Geneki = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox10.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.Status_Intai = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox11.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.OwnerHorse = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox12.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.ClubHorse = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox13.CheckedChanged += ( obj, e )=>{
                this.umaListView_Config_.SaleHorse = ((CheckBox)obj).Checked;
                this.checkBox1.Enabled = !this.checkBox13.Checked;
                this.checkBox2.Enabled = !this.checkBox13.Checked;
                this.checkBox6.Enabled = !this.checkBox13.Checked;
                this.checkBox7.Enabled = !this.checkBox13.Checked;
                this.checkBox8.Enabled = !this.checkBox13.Checked;
                this.checkBox11.Enabled = !this.checkBox13.Checked;
                this.checkBox12.Enabled = !this.checkBox13.Checked;
                this.DispHorseList();
            };
            this.checkBox14.CheckedChanged += (obj, e)=> {
                this.checkBox11.Enabled = !((CheckBox)obj).Checked;
                this.checkBox12.Enabled = !((CheckBox)obj).Checked;
                this.checkBox15.Enabled = !((CheckBox)obj).Checked;
                this.umaListView_Config_.WatchHorse = ((CheckBox)obj).Checked;
                this.DispHorseList();
            };
            this.checkBox15.CheckedChanged += (obj, e)=> {
                this.checkBox11.Enabled = !((CheckBox)obj).Checked;
                this.checkBox12.Enabled = !((CheckBox)obj).Checked;
                if( this.tabControl1.SelectedIndex == 0 ) {
                    this.checkBox14.Enabled = !((CheckBox)obj).Checked;
                }
                this.umaListView_Config_.CurrentHorse = ((CheckBox)obj).Checked;
                try {
                    this.DispHorseList();
                } catch( Exception ex ) {
                    var message = String.Format( "エラーが発生しました - {0}", ex.Message );
                    MessageBox.Show( message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error );
                    this.umaListView_Config_.CurrentHorse = false;
                    this.checkBox15.Checked = false;
                }
            };

            this.toolStripStatusLabel1.Text = "";
            this.toolStripStatusLabel2.Text = "";
            this.toolStripStatusLabel3.Text = "";
            this.toolStripStatusLabel4.Text = "";

            this.umaListView_Config_ = new UMAListView.Config() {
                Age_0         = this.checkBox1.Checked,
                Age_1         = this.checkBox2.Checked,
                Age_2         = this.checkBox3.Checked,
                Age_3         = this.checkBox4.Checked,
                Age_ETC       = this.checkBox5.Checked,
                Country_JAPAN = this.checkBox6.Checked,
                Country_USA   = this.checkBox7.Checked,
                Country_EURO  = this.checkBox8.Checked,
                Status_Geneki = this.checkBox9.Checked,
                Status_Intai  = this.checkBox10.Checked,
                OwnerHorse    = this.checkBox11.Checked,
                ClubHorse     = this.checkBox12.Checked,
                SaleHorse     = this.checkBox13.Checked,
                WatchHorse    = this.checkBox14.Checked,
                CurrentHorse  = this.checkBox15.Checked,
            };
            this.tabControl1_SelectedIndexChangedHandler( this.tabControl1, null );
        }
Esempio n. 2
0
        private void BreedingAndDisp( UInt32 horse_num )
        {
            var config = new UMAListView.Config() {
                BreedingArea  = this.area_,
                Country_JAPAN = this.checkBox1.Checked,
                Country_USA   = this.checkBox2.Checked,
                Country_EURO  = this.checkBox3.Checked,
                Status_Geneki = this.checkBox4.Checked,
                Status_Intai  = this.checkBox5.Checked,
                OwnerHorse    = this.checkBox7.Checked,
                ClubHorse     = this.checkBox8.Checked,
                MaxRisk       = ((KeyValuePair<String,UInt32>)this.comboBox1.SelectedItem).Value,
                DispNameType  = this.dispNameType_,
            };

            this.breedingPartnerListView.ListViewConfig = config;
            this.breedingPartnerListView.ListViewDefaultSortColumn = 4;
            this.breedingPartnerListView.CreateHorseList( this.wp_, horse_num );
            this.GCCollect();
        }