Instantiate internal class with public constructor in third party assembly

323 Views Asked by At

I would like to instantiate an internal class of a third party with a public constructor, the class Microsoft.AnalysisServices.XmlaClient to be exact. Ideally, I would like to end up being able to access the methods like instance.Connect(blabla) etc. Is this possible through Reflection?

namespace Microsoft.AnalysisServices
{
    internal class XmlaClient
    {
        public XmlaClient();

        public ConnectionInfo ConnectionInfo { get; }
        public string SessionID { get; set; }

        public void CancelCommand(string sessionID);
        public void Connect(string connectionString);
        public void Connect(ConnectionInfo connectionInfo);
        public void Connect(ConnectionInfo connectionInfo, bool beginSession);
        public void Connect(ConnectionInfo connectionInfo, string sessionID);
        public void Connect(string connectionString, bool beginSession);
        public void Connect(string connectionString, string sessionID);
        public void Disconnect();
        public void Disconnect(bool endSession);
        public ConnectionState GetConnectionState(bool pingServer);
        public void Reconnect();
    }
}
0

There are 0 best solutions below