示例#1
0
        /// <summary>
        /// 馬リストをフォームに表示する
        /// </summary>
        private void DispHorseList()
        {
            if( this.wp_ == null ) {
                return;
            }
            this.UpdateFormTitle();

            var sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            var horse_type = (Enums.HorseType) this.tabControl1.TabPages[ this.tabControl1.SelectedIndex ].Tag;

            this.umaListView_Config_.DispNameType = this.setting_.DispNameType;

            if( this.umaListView_ != null && this.currentHorseType_ == horse_type ) {
                this.umaListView_.CreateHorseList( this.wp_ );
            } else {
                UMAListView.UMAListViewTpl uma_listview;
                UMAListView.Setting uma_listview_setting;

                this.UpdateUMAListViewSetting();

                switch( horse_type )
                {
                case Enums.HorseType.CHILD:
                    uma_listview = new HorseChildListView( this.umaListView_Config_, this.setting_.Mode, this.extension_setting_.HorseChildExtensions, this.ExtenstionsDir );
                    uma_listview_setting = this.setting_.HorseChildSetting;
                    break;
                case Enums.HorseType.RACE:
                    uma_listview = new HorseRaceListView( this.umaListView_Config_, this.setting_.Mode, this.extension_setting_.HorseRaceExtensions, this.ExtenstionsDir );
                    uma_listview_setting = this.setting_.HorseRaceSetting;
                    break;
                case Enums.HorseType.DAM:
                    uma_listview = new HorseDamListView( this.umaListView_Config_, this.setting_.Mode, this.extension_setting_.HorseDamExtensions, this.ExtenstionsDir );
                    uma_listview_setting = this.setting_.HorseDamSetting;
                    break;
                case Enums.HorseType.SIRE:
                    uma_listview = new HorseSireListView( this.umaListView_Config_, this.setting_.Mode, this.extension_setting_.HorseSireExtensions, this.ExtenstionsDir );
                    uma_listview_setting = this.setting_.HorseSireSetting;
                    break;
                default:
                    MessageBox.Show("[BUG]");
                    return;
                }

                if( this.mainPanel.Controls.Count != 0 ) {
                    this.umaListView_.Dispose();
                    this.mainPanel.Controls.Clear();
                    this.umaListView_ = null;
                }
                this.umaListView_ = uma_listview;
                this.umaListView_.Dock = DockStyle.Fill;
                this.umaListView_.FromSetting( uma_listview_setting );
                this.umaListView_.CreateHorseList( this.wp_ );
                this.mainPanel.Controls.Add( this.umaListView_ );
                this.currentHorseType_ = horse_type;
            }

            sw.Stop();

            this.toolStripStatusLabel2.Text = String.Format( "{0}(ms)", sw.ElapsedMilliseconds );
            this.toolStripStatusLabel3.Text = String.Format( "{0}(line)", this.umaListView_.ItemsCount );
            this.toolStripStatusLabel4.Text = String.Format( "白毛:{0}(頭)", this.umaListView_.WhiteColorHorseCount );

            this.GC_Collect();
        }
示例#2
0
        /// <summary>
        /// タブを切り替えたときに発生するイベントハンドラ
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tabControl1_SelectedIndexChangedHandler( Object sender, EventArgs e )
        {
            var ti = this.tabControl1.SelectedIndex;

            if( ti == -1 ) {
                return;
            }

            var tp = this.tabControl1.TabPages[ ti ];

            tp.Controls.AddRange(new Control[]{
                this.mainPanel,
                this.panel1,
            });

            switch( (Enums.HorseType)tp.Tag )
            {
            case Enums.HorseType.RACE:
                this.checkBox1.Enabled = false;
                this.checkBox2.Enabled = false;
                this.checkBox3.Enabled = true;
                this.checkBox4.Enabled = true;
                this.checkBox5.Enabled = true;
                this.checkBox6.Enabled = true;
                this.checkBox7.Enabled = true;
                this.checkBox8.Enabled = true;
                this.checkBox9.Enabled = true;
                this.checkBox10.Enabled = true;
                this.checkBox11.Enabled = true;
                this.checkBox12.Enabled = true;
                this.checkBox13.Enabled = false;
                this.checkBox14.Enabled = true;
                break;

            case Enums.HorseType.CHILD:
                //this.checkBox1.Enabled = true;
                //this.checkBox2.Enabled = true;
                this.checkBox3.Enabled = false;
                this.checkBox4.Enabled = false;
                this.checkBox5.Enabled = false;
                this.checkBox9.Enabled = false;
                this.checkBox10.Enabled = false;
                this.checkBox13.Enabled = true;
                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.checkBox14.Enabled = false;
                break;

            case Enums.HorseType.DAM:
                this.checkBox1.Enabled = false;
                this.checkBox2.Enabled = false;
                this.checkBox3.Enabled = false;
                this.checkBox4.Enabled = false;
                this.checkBox5.Enabled = false;
                this.checkBox6.Enabled = true;
                this.checkBox7.Enabled = true;
                this.checkBox8.Enabled = true;
                this.checkBox9.Enabled = true;
                this.checkBox10.Enabled = true;
                this.checkBox11.Enabled = true;
                this.checkBox12.Enabled = true;
                this.checkBox13.Enabled = false;
                this.checkBox14.Enabled = false;
                break;

            case Enums.HorseType.SIRE:
                this.checkBox1.Enabled = false;
                this.checkBox2.Enabled = false;
                this.checkBox3.Enabled = false;
                this.checkBox4.Enabled = false;
                this.checkBox5.Enabled = false;
                this.checkBox6.Enabled = true;
                this.checkBox7.Enabled = true;
                this.checkBox8.Enabled = true;
                this.checkBox9.Enabled = true;
                this.checkBox10.Enabled = true;
                this.checkBox11.Enabled = true;
                this.checkBox12.Enabled = true;
                this.checkBox13.Enabled = false;
                this.checkBox14.Enabled = false;
                break;
            }

            try {
                this.DispHorseList();
            } catch( Exception ex ) {
                this.currentHorseType_ = WP7_2012ULV.Enums.HorseType.UNKNOWN;
                var message = String.Format( "エラーが発生しました - {0}", ex.Message );
                MessageBox.Show( message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error );
            }
        }
示例#3
0
        /// <summary>
        /// 取得ボタンを押したときのイベントハンドラ
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            if( this.wp_ != null ) {
                this.wp_.Dispose();
                this.wp_ = null;
            }

            if( this.BreedingFormList.Count > 0 ) {
                foreach( var form in this.BreedingFormList ) {
                    form.Close();
                    form.Dispose();
                }
                this.BreedingFormList.Clear();
            }

            #if DEBUG // --------------------------------------------------------------
            var asm = System.Reflection.Assembly.Load( this.setting_.VersionConfigAssembly.AssemblyName );
            var config = (KOEI.WP7_2012.ConfigurationInterface)Activator.CreateInstance( asm.GetType( this.setting_.VersionConfigAssembly.ClassName ) );
            this.wp_ = new KOEI.WP7_2012.WP7( config.ProcessName, config, this.setting_.Mode );
            this.DispHorseList();
            #else // ------------------------------------------------------------------
            try {
                var asm = System.Reflection.Assembly.Load( this.setting_.VersionConfigAssembly.AssemblyName );
                var config = (KOEI.WP7_2012.ConfigurationInterface)Activator.CreateInstance( asm.GetType( this.setting_.VersionConfigAssembly.ClassName ) );
                this.wp_ = new KOEI.WP7_2012.WP7( config.ProcessName, config, this.setting_.Mode );
                this.DispHorseList();
            } catch( Exception ex ) {
                this.currentHorseType_ = WP7_2012ULV.Enums.HorseType.UNKNOWN;
                var message = String.Format( "エラーが発生しました - {0}", ex.Message );
                MessageBox.Show( message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error );
            }
            #endif // -----------------------------------------------------------------
        }