public FormMain() { InitializeComponent(); // this.Request_textBox.DataBindings.Add("Text", this, "RequestQuantity"); this.Request_panel.Controls.Add(this.Request_textBox); this.Request_panel.Controls.Add(this.RequestConfirm_ucBtnExt); this.headNode = new DulAreaList(); headNode.InitDulAreaList(); // this.UpdateRows(); }
private void Edit_ucBtnExt_BtnClick(object sender, EventArgs e) { FormEdit formEdit = new FormEdit(); if (formEdit.ShowDialog() == DialogResult.OK) { this.MemorySize = formEdit.Modify; this.headNode = new DulAreaList(); this.headNode.InitDulAreaList(MemorySize); this.UpdateRow(); this.DrawMemory(); } }
public FormMain(int request) { InitializeComponent(); this.StartPosition = FormStartPosition.CenterScreen; this.ucSplitLabel1.Text = null; this.ucSplitLabel2.Text = "内存分配(首次适应算法)"; List <DataGridViewColumnEntity> clmn = new List <DataGridViewColumnEntity>(); clmn.Add(new DataGridViewColumnEntity() { DataField = "AreaID", HeadText = "分区号", Width = 50, WidthType = SizeType.AutoSize }); clmn.Add(new DataGridViewColumnEntity() { DataField = "Start", HeadText = "起始地址", Width = 50, WidthType = SizeType.AutoSize }); clmn.Add(new DataGridViewColumnEntity() { DataField = "Length", HeadText = "分区大小", Width = 50, WidthType = SizeType.AutoSize }); clmn.Add(new DataGridViewColumnEntity() { DataField = "State", HeadText = "状态", Width = 50, WidthType = SizeType.AutoSize }); this.ucDataGridView1.Columns = clmn; //this.Request_textBox.DataBindings.Add("Text", this, "RequestQuantity"); List <KeyValuePair <string, string> > keyValues = new List <KeyValuePair <string, string> >(); keyValues.Add(new KeyValuePair <string, string>("0", "请求分配")); keyValues.Add(new KeyValuePair <string, string>("1", "请求回收")); this.ucCombox1.Source = keyValues; this.Request_panel.Controls.Add(this.Request_textBox); this.Request_panel.Controls.Add(this.RequestConfirm_ucBtnExt); this.headNode = new DulAreaList(); headNode.InitDulAreaList(request); this.MemorySize = request; //this.UpdateRows(); this.UpdateRow(); }