예제 #1
0
        private static Control GetEditor(this IPtrAccessor @this)
        {
            var editor = new ComboBox();

            editor.UpdateComboBoxWith(@this);

            return(editor);
        }
예제 #2
0
        private void frmChunkFlowDiagram_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (Form.ModifierKeys != Keys.Control)
                {
                    foreach (var c in ChunkEditors.Values)
                    {
                        var conns = c.GetConnections();
                        if (conns != null)
                        {
                            for (var i = 0; i < conns.Count; i++)
                            {
                                var sp = c.GetConnectionLocation(i);

                                var rect = new Rectangle(c.Location.X + c.Width, c.Location.Y + sp.Y - connectionPointSize / 2,
                                                         connectionPointSize, connectionPointSize);
                                if (rect.Contains(e.Location))
                                {
                                    connectingSource       = conns[i];
                                    connectingSourceEditor = c;
                                    connectingSourceIndex  = i;
                                    isConnecting           = true;
                                    return;
                                }
                            }
                        }
                    }

                    selectionStart = e.Location;
                    isSelecting    = true;
                }
                else
                {
                    prevMousePos = e.Location;
                    isMoving     = true;
                }
            }
        }