ME3Creator.Objectselect.Init C# (CSharp) Method

Init() public method

public Init ( PCCPackage pcc, int index ) : void
pcc ME3LibWV.PCCPackage
index int
return void
        public void Init(PCCPackage pcc, int index)
        {
            comboBox1.Items.Clear();
            comboBox2.Items.Clear();
            for (int i = 0; i < pcc.Header.ExportCount; i++)
                comboBox1.Items.Add(i.ToString("d6") + " : " + pcc.GetObjectPath(i + 1) + pcc.getObjectName(i + 1));
            for (int i = 0; i < pcc.Header.ImportCount; i++)
                comboBox2.Items.Add(i.ToString("d6") + " : " + pcc.GetObjectPath(-i - 1) + pcc.getObjectName(-i - 1));
            comboBox1.SelectedIndex = comboBox2.SelectedIndex = 0;
            if (index == 0)
                r1.Checked = true;
            if (index > 0)
            {
                comboBox1.SelectedIndex = index - 1;
                r2.Checked = true;
            }
            if (index < 0)
            {
                comboBox2.SelectedIndex = -index - 1;
                r3.Checked = true;
            }
        }

Usage Example

Example #1
0
        public static int? GetValue(PCCPackage p, int index)
        {
            Objectselect prompt = new Objectselect();
            prompt.Init(p, index);

            return prompt.ShowDialog() == DialogResult.OK ? prompt.returnValue() : null;
        }
All Usage Examples Of ME3Creator.Objectselect::Init