示例#1
0
        private void ParametersDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.CurrentRow != null)
            {
                this.CurrentCell = this.CurrentRow.Cells[0];

                //open expression form
                ExpressionReturnForm expressionForm = null;

                Expression selectedExpression = null;
                if (getTypedExpressions().Count > CurrentRow.Index)
                {
                    selectedExpression = getTypedExpressions()[CurrentRow.Index];
                }



                expressionForm = new ExpressionReturnForm(controller.getExpressionProvider(), selectedExpression, repository);

                if (expressionForm.ShowDialog() == DialogResult.OK)
                {
                    //replace old expression with newly created one
                    Expression createdExpression = expressionForm.getUnderlyingExpression();

                    DataTable.Rows[CurrentRow.Index][0] = createdExpression.ToString();
                    typedExpressions[CurrentRow.Index]  = createdExpression;
                }
            }
        }
示例#2
0
        private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            setInformationLossBoolean();
            ExpressionTreeNode clickedNode = e.Node as ExpressionTreeNode;

            if (e.Node.Parent != null)
            {
                ExpressionReturnForm returnForm = new ExpressionReturnForm(expressionProvider.getMainProvider(), clickedNode.Expression, repository);
                if (returnForm.ShowDialog() == DialogResult.OK)
                {
                    Expression newExpression = returnForm.getUnderlyingExpression();
                    ((clickedNode.Parent as ExpressionTreeNode).Expression as MethodCallExpression).OwnedParameterBinding[clickedNode.Index].ValueExpression = newExpression;

                    updateTreeView();
                }
            }
            handleLiteralExpressionForm(clickedNode.Expression);
        }