Interface function C# -


I have a function that implements the interface. Something like this:

  String IMI Interface My Function () {Something; }  

This function is available outside of my class. Everything is working right now I have to call this function from any other local non-public function. Like this:

  void Func2 () {string s; S = MyFunction (); }  

The problem is that I get this error: "name my function is not present in the current context"

Any help would be appreciated.

TY.

You have implemented the interface method explicitly. Cast "this" for the interface, and you are there:

  void Func2 () {string s = ((IMyInterface) this). MyFunction (); }  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -