void DirectClicked(ToolStripMenuItem clickeditem, Block blockobject,BlockData bdata,ManyToOneBlockData mtodata) { BlockData getbd; ManyToOneBlockData getmanytoone; Block acquireBlock; getbd = bdata; getmanytoone = mtodata; acquireBlock = blockobject; //set some defaults. if (getmanytoone != null) { //manyto one block. Should show name of "actual" type. Text = getmanytoone.DisplayText; ToolTipText = blockobject.GetType().Name + " - " + getmanytoone.DisplayText; //we need to draw it speshul. Bitmap resultimage = null; Graphics resultg = null; Block.DrawBlock(blockobject, out resultimage, out resultg); Image = resultimage; } else { Text = bdata.BlockType.Name; ToolTipText = Text; Image = bdata.useBlockImage; } var gotargs = new BlockToolStripButtonBlockSelectedArgs(blockobject, getmanytoone, bdata); var copied = BlockSelected; if (copied != null) copied(this, gotargs); SelectedItem = gotargs; }
public BlockToolStripButtonBlockSelectedArgs(Block pSelectedBlock,ManyToOneBlockData pManyToOneBlockData, BlockData pbdata) { _SelectedBlock = pSelectedBlock; _ManyToOneData= pManyToOneBlockData; _bdata = pbdata; }