protected override void OnImportAction() { base.OnImportAction(); AB_DecisionTableActions av = this.ActionObject as AB_DecisionTableActions; if (av != null) { ActionName = av.Name; Description = av.Description; } else { DesignUtil.WriteToOutputWindowAndLog("Decision table not found"); } }
protected virtual void OnPaintAction(PaintEventArgs e) { int nLeft = 0; //draw action AB_DecisionTableActions av = this.ActionObject as AB_DecisionTableActions; if (ActionImage == null) { SetActionImage(Resources.decisionTable); } Bitmap img = ActionImage; switch (av.IconLayout) { case EnumIconDrawType.Fill: if (this.Size.Width > 4 && this.Size.Height > 4) { e.Graphics.DrawImage(img, 1, 1, this.Size.Width - 4, this.Size.Height - 4); nLeft = 1; } break; case EnumIconDrawType.Left: e.Graphics.DrawImage(img, 1, (this.Size.Height - img.Height) / 2, img.Size.Width, img.Size.Height); nLeft = 1 + img.Width; break; case EnumIconDrawType.Center: e.Graphics.DrawImage(img, (this.Size.Width - img.Width) / 2, (this.Size.Height - img.Height) / 2, img.Size.Width, img.Size.Height); nLeft = 1; break; } SizeF sz = e.Graphics.MeasureString(this.ActionDisplay, TextFont); float x = (Size.Width - sz.Width - nLeft) / 2 + nLeft; float y = (Size.Height - sz.Height) / 2; if (x < 0) { x = 0; } if (y < 0) { y = 0; } e.Graphics.DrawString(this.ActionDisplay, TextFont, TextBrush, x, y); }
protected override void OnEditAction() { MethodDiagramViewer mv = this.DiagramViewer; if (mv != null) { LimnorProject project = mv.Project; AB_DecisionTableActions av = this.ActionObject as AB_DecisionTableActions; //string name = av.Name; DlgDecisionTable dlg = new DlgDecisionTable(); dlg.LoadData(av.DecisionTable, mv.Method, project, mv.DesignerHolder); if (dlg.ShowDialog(this.FindForm()) == DialogResult.OK) { av.DecisionTable = dlg.Result; mv.Changed = true; } } }