コード例 #1
0
        protected void UpdateArrayFileText(object sender, EventArgs e)
        {
            if (Prompt.UpdateArrayFile() == DialogResult.Yes)
            {
                File.RenameEntry((uint)EntryValueBox.Value, EntryComboBox.Text);

                EntryComboBox.DataSource = File.ToList();
            }
        }
コード例 #2
0
        public void Load(ArrayFile file)
        {
            File = file;

            int longestString = 0;

            for (uint i = 0; i <= File.LastEntry; i++)
            {
                if (File[i].Length > longestString)
                {
                    longestString = File[i].Length;
                }
            }

            if (AutoSize)
            {
                this.Size           = new Size(EntryValueBox.Width + 30 + longestString * 5, 26);
                EntryComboBox.Width = this.Width - EntryValueBox.Width - 10;
                this.AutoSize       = false;
            }

            //if (File.LastEntry != 0) EntryValueBox.Maximum = File.LastEntry;

            EntryValueBox.MouseWheel += delegate(object sender, MouseEventArgs e)
            {
                ((HandledMouseEventArgs)e).Handled = true;
            };
            EntryComboBox.DataSource            = File.ToList();
            EntryComboBox.ValueMember           = "Key";
            EntryComboBox.DisplayMember         = "Value";
            EntryComboBox.SelectedValueChanged += UpdateEntryValueBox;
            EntryComboBox.TextUpdate           += UpdateArrayFileText;
            EntryComboBox.MouseWheel           += delegate(object sender, MouseEventArgs e)
            {
                ((HandledMouseEventArgs)e).Handled = true;
            };

            UpdateEntryComboBox(this, null);
        }