0 Replies Last post: Feb 23, 2013 5:13 AM by Brian Leech  
Brian Leech Newbie 1 posts since
Feb 23, 2013
Currently Being Moderated

Feb 23, 2013 5:13 AM

Structural search for property get but not set

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;

 

with:

 

var x = ugr.GetCellValue("foo");

 

(where ugr is of type UltraGridRow)

 

but I don't want to replace:

 

ugr.Cells["foo"].Value = 7

 

with:

 

ugr.GetCellValue("foo").Value = 7;

 

(this won't compile).

 

I have a rule that works for the first case, where:

 

$ugr$.Cells[$key$].Value

 

is replaced with:

 

$ugr$.GetCellValue($key$)

 

 

Is there a way to make the rule not match the assignment to the property, only the read access?

 

Thanks,

Brian

More Like This

  • Retrieving data ...