c# - IntelliSense do not work with extension method when property name is the same as class name -
based on answer: " should property have same name type? ", i've started use property names same class names. i've met strange corner case , don't know if problem , how solve it. here code repeat case:
class r { public test test { get; private set; } public r() { test = new test(); // intellisense not working here: // test.use( } } public class test { } public static class extensions { public static void use(this test test, string msg) { console.writeline(msg); } }
i'm using vs2010 , .net framework 4.0
here video showing problem: http://www.youtube.com/watch?v=hgszau_pir0&feature=youtu.be
could try using .this when selecting property?
eg. this.test.use() ..
Comments
Post a Comment