コード例 #1
0
ファイル: MemoryAmie.cs プロジェクト: ShadowMario3/PKHeX
        private void UpdateMemoryDisplay(object sender)
        {
            if (sender == CB_OTMemory)
            {
                int memoryGen = pkm.Generation;
                if (memoryGen < 0)
                {
                    memoryGen = pkm.Format;
                }

                int memory   = WinFormsUtil.GetIndex((ComboBox)sender);
                var memIndex = Memories.GetMemoryArgType(memory, memoryGen);
                var argvals  = MemStrings.GetArgumentStrings(memIndex, memoryGen);
                CB_OTVar.InitializeBinding();
                CB_OTVar.DataSource = new BindingSource(argvals, null);
                LOTV.Text           = TextArgs.GetMemoryCategory(memIndex, memoryGen);
                LOTV.Visible        = CB_OTVar.Visible = CB_OTVar.Enabled = argvals.Count > 1;
            }
            else
            {
                int memoryGen = pkm.Format;
                int memory    = WinFormsUtil.GetIndex((ComboBox)sender);
                var memIndex  = Memories.GetMemoryArgType(memory, memoryGen);
                var argvals   = MemStrings.GetArgumentStrings(memIndex, memoryGen);
                CB_CTVar.InitializeBinding();
                CB_CTVar.DataSource = new BindingSource(argvals, null);
                LCTV.Text           = TextArgs.GetMemoryCategory(memIndex, memoryGen);
                LCTV.Visible        = CB_CTVar.Visible = CB_CTVar.Enabled = argvals.Count > 1;
            }
        }
コード例 #2
0
        private void UpdateMemoryDisplay(object sender)
        {
            int memory   = WinFormsUtil.GetIndex((ComboBox)sender);
            var memIndex = Memories.GetMemoryArgType(memory);
            var argvals  = GameInfo.Sources.Memories.GetArgumentStrings(memIndex);

            if (sender == CB_CTMemory)
            {
                CB_CTVar.InitializeBinding();
                CB_CTVar.DataSource = new BindingSource(argvals, null);
                LCTV.Text           = TextArgs.GetMemoryCategory(memIndex);
                LCTV.Visible        = CB_CTVar.Visible = CB_CTVar.Enabled = argvals.Count > 1;
            }
            else
            {
                CB_OTVar.InitializeBinding();
                CB_OTVar.DataSource = new BindingSource(argvals, null);
                LOTV.Text           = TextArgs.GetMemoryCategory(memIndex);
                LOTV.Visible        = CB_OTVar.Visible = CB_OTVar.Enabled = argvals.Count > 1;
            }
        }