Class Diagram Method Name Change Propogation

Terkunci Class Diagram Method Name Change Propogation

  • 24 Juni 2009 14:04
     
     
    When I add a new method to a new class via a class diagram, the method is added with the name "Method" selected in a text box ready for me to give it a real name.  When I type the real name, "MyRealMethod", every instance of the word "Method" in my project/solution (coment or code) is replaced with "MyRealMethod".  I had hundreds of files, unrelated to my new class, changed that I had to undo.  The same thing happens with a "field" addtion. How do I avoid this?

Semua Balasan

  • 26 Juni 2009 3:13
     
     
    Hi KevsPlace,

    It works well on my computer. Could you provide the version of the VS that you use? Express or Standard?
    You can show me some pictures that the problem happens.
    How to insert image:  http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/33bf2119-5f56-40b2-a689-d437ec09e550

    On my computer it looks like this:


    Have you installed any third party add-in to the VS?
    Here is a method that to avoid the third party add-in.

    Try disabling Add-ins (e.g. Tools | Add-in Manager) or run devenv.exe /SafeMode.This can eliminate the possibility that third party Add-ins or packages are causing problems. (For more detailed VS command line switches information, see: http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx )


    Please update the thread and we will have a further discussion.

     

     

    Best Regards

    Yichun Feng



    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • 26 Juni 2009 9:45
     
     
    Thanks for your reply!

    I am using VS 2008 Team System with no addins.

    Sorry, but I can not post pictures for security reasons.  I am not sure they will add anything because the ramification of the problem does not manifest itself in the diagram, rather, it shows up in all the source files.  I will describe the problem in steps:

    I create a class that inherits from none.  It has one association to it and one association from it.  It has a few fields, properties, and methods.  With the class expanded, I right click on the Fields, Properites, or Methods heading in the class box and select Add->Method for example.  When I do this, I get a new method called "Method" with the text "Method" selected and ready for me to type the real name.  When I type the real name, VS then starts changing all of the occurances of the word "Method" within my solution/project. 

    It appears similar to the VS refactor feature of renaming with the "search in strings" and "search in comments" selected.  However, when using this refactor feature, the files usually affected are only those that invoke the method and reference its class.  Not every occurance of the refactored method name string were ever it would appear in the project as is occuring when I change the name via the class diagram.
     
  • 30 Juni 2009 4:07
     
     Jawab
    Hi KevsPlace,

    Your problem is rather strange to reproduce. Do you have the same problem on the other computer with VS2008?
    If it happens on the other computer, you can post your suggest here: https://connect.microsoft.com/VisualStudio
    If it doesn't happen, you can repair your VS or reset to the default settings.

    Best Regards

    Yichun Feng




    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • 05 Juli 2011 17:24
     
     

    I am having a similar problem in Visual Studio 2010 Pro Sp1. I have had this problem in VS 2008 also. It even renames instances of a method/field/property name in the code comments in completely unrelated files in my solution, which is VERY large by the way. 

     

    Because of this problem i am not comfortable using this great tool... shame.

  • 07 Nopember 2011 13:06
     
     
  • 10 Nopember 2011 10:18
     
     

    lists box code