I am interested both in built-in feature or a workaround, it does not matter.
My problem is similar to the question "how to get a name of the field/property of the object" -- so you could not write
"MyField"
anymore, but
NameOf(MyField)
Now, one level up -- and you have not a class, but a project, and not a field, but element of the project -- report, dataset, and so on. I would like to switch from writing:
LoadReport("MyReport.rdlc");
to
LoadReport(NameOf(Project.MyReport)+".rdlc");
Of course this is rough idea.
If you wonder why -- because when refactoring, I would like to have all names replaced automatically.
The question is -- is this possible, and if yes -- how?
Edits
- Please note refactoring is done in design-time, so getting the actual name can be done in runtime, but binding to it has to be done in design time, not in runtime (so pure reflection is ruled out).