I'm somewhat of a beginner to C# and I am developing some user controls that will get used in several different applications with different implementations. What I want to do is include the implementation specific items in a file, call it Implementation.cs and then have a user control compiled into control.dll. Implementation.cs will contain static methods that control.dll will use, such as "int GetValue(string tag)" or something like that.
The end application will reference both control.dll and Implementation.cs So my question is, how do I tell th开发者_StackOverflow社区e code in control.dll that there is a method of "int GetValue(string tag)" since GetValue() lives in Implementation.cs ? I tried the extern keyword, but it seems to want the dllimport specifier which I don't want since I'm not using a separate dll file for the implementation.
I'd be happy to look for more information myself but I'm having trouble even getting the right keywords to do a search.
If I understand correctly your question then, you will find the following resources valuable:
- Abstract class
- Interface
- Dependency injection
精彩评论