Problem with Extract Method Selection

2 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 05 Aug 2011 Link to this post

    Ok so here's the line

    newItem.PickTypeID = Convert.ToByte((oldItem.DoesResidentPickThisApprover == true) ? 2 : 0);

    So I needed to expand on the logic to the right of the =

    So I selected everything after convert and extracted the method and it removed the newItem.PickTypeID = and converted the ENTIRE line into a new method

    GetPickType(newItem, oldItem);

    ...can this be fixed please?
  2. Svetlozar
    Admin
    Svetlozar avatar
    270 posts

    Posted 05 Aug 2011 Link to this post

    Hi Steve,

    Execute me If I am missing something.

    You want to extract the right side of the assignment, right?

    In that line you have a statement with an expression. If you want to extract only the expression you have to select only the expression (without ;), otherwise we expand to the enclosing statement, which is the assignment.

    Greetings,
    Svetlozar
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. DevCraft banner
Back to Top