I have a WinForm that interacts with WebBrowserControl through ObjectForScripting. The base field of my WinForm is not ComVisible, and I cannot change it or not change it. Since NonComVisibleBaseClass exists, I created the interface and installed it ComVisible (true) and set FormAttribute [ClassInterface (ClassInterfaceType.None)]. Methods in the interface can be called by JavaScript. And it works great:
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
public partial class GeekBrowser : GeekBasePage, IMapControlInteractable
...
public class GeekBasePage : System.Windows.Forms.Form
...
[ComVisible(true)]
public interface IMapControlInteractable
But now my problem. The interface contains several functions. I want to separate interfaces for separate task groups. So I need an interface that contains logging functions and an interface for DataAccess functions, etc.
So it would be something like:
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
public partial class GeekBrowser : GeekBasePage, IDataAccess, ILogging
...
public class GeekBasePage : System.Windows.Forms.Form
...
[ComVisible(true)]
public interface IDataAccess
...
[ComVisible(true)]
public interface ILogging
, (ILogging) Javascript. , IDataAccess .
, , Javascript .
, ? , BaseClass ComVisible ClassInterface , .
!