Locate Filter
Have you ever looked at something a thousand times and then look at it again one more time and discover something new? That's how I feel today about ILocateCommandEvents_LocateFilter.
How many times have I looked at the locate filter and never noticed the Accepted parameter? Has it always been there? Well ok, here's the deal. Accepted is true when the filter method is called. And as long as Accepted is still True after this method has run the ILocateCommandEvents_Accept method runs. And of course if Accepted is False then the located failed method is run. So, umm, no need to restart the command if the filter fails since that's taken care of by the locate failed method. And, the coolest thing about filter is that it only allows you to select and highlight elements that pass the filter. That means you can't select the wrong element and you don't need to build a filter into the Accept method.
Ok, here's an example.
Accepted is set to False - assume failure. If a cell named Structure is clicked then the location passes, else Accepted remains false and locate failed is called.



0 Comments:
Post a Comment
<< Home