private void AddMethod(SMMethod method) { // // compIDCtl // MPIDCtl compIDCtl = new MCore.Controls.MPIDCtl(); _list.Add(compIDCtl); // 1 based int count = _list.Count; SetNewSizes(); compIDCtl.Location = new System.Drawing.Point(6, count * SPACING); compIDCtl.Name = string.Format("IDCtl_{0}", count); compIDCtl.ReturnType = MPIDCtl.eTypes.Void; // compIDCtl.Size = new System.Drawing.Size(502, 21); compIDCtl.Size = new System.Drawing.Size(this.gbMethods.Width, 21); compIDCtl.TabIndex = count; compIDCtl.ScopeID = _actTransFlowItem.ParentContainer.ScopeID; if (method != null) { this._id = method.MethodID; } else { this._id = string.Empty; } compIDCtl.BindTwoWay(() => ID); this.gbMethods.Controls.Add(compIDCtl); }
private void btnOk_Click(object sender, EventArgs e) { _actTransFlowItem.Text = tbText.Text; int i = 0; for (; i < _list.Count - 1; i++) { if (i < _actTransFlowItem.Count) { string oldVal = (_actTransFlowItem[i] as SMMethod).MethodID; if (oldVal != _list[i].ID) { (_actTransFlowItem[i] as SMMethod).MethodID = _list[i].ID; U.LogChange(string.Format("{0}.Method-{1}", _actTransFlowItem.Nickname, i), oldVal, _list[i].ID); } } else { SMMethod method = new SMMethod(string.Empty); _actTransFlowItem.Add(method); method.MethodID = _list[i].ID; U.LogChangeAdded(string.Format("{0}.Method-{1} : {2}", _actTransFlowItem.Nickname, i, method.MethodID)); } } int count = _actTransFlowItem.Count; for (; i < count; i++) { int iRemove = _actTransFlowItem.Count - 1; U.LogChangeRemoved(string.Format("{0}.Method-{1} : {2}", _actTransFlowItem.Nickname, iRemove, (_actTransFlowItem[iRemove] as SMMethod).MethodID)); _actTransFlowItem.RemoveLast(); } _actTransFlowItem.Rebuild(); _containerPanel.Redraw(_actTransFlowItem); Close(); }