I'm trying to use structural search to find read (get) accesses to a property but not write (set) accesses. In this case, it's for replacing assignments to an Infragistics UltraGridCell's Value property. I want to replace
var x = ugr.Cells["foo"].Value;
var x = ugr.GetCellValue("foo");
(where ugr is of type UltraGridRow)
but I don't want to replace:
ugr.Cells["foo"].Value = 7
ugr.GetCellValue("foo").Value = 7;
(this won't compile).
I have a rule that works for the first case, where:
is replaced with:
Is there a way to make the rule not match the assignment to the property, only the read access?