MscrmTools / MscrmTools.Xrm.Connection

Provides Winforms control to connect to Microsoft Dynamics CRM deployments
GNU Lesser General Public License v3.0
23 stars 38 forks source link

Allow loading connection list from external assembly #161

Closed MarkMpn closed 3 months ago

MarkMpn commented 9 months ago

We currently have the option to load a connection list from a URL, which lets a web server dynamically generate the XML list of connections. However, this has a limitation of only allowing Windows authentication for that site.

This PR allows adding a .NET assembly as a connection list as well as a simple XML file. If an assembly is selected it will find a class in that assembly that implements a new ICrmConnectionsProvider interface, create an instance of that provider type and call a method on it to retrieve a list of collections. This allows organisations to implement completely custom logic to provide a list of connections. For example, a central database of connections for all their customers but different consultants have access to only the instances they require.

It also makes various methods on the ConnectionDetail class virtual. This allows the provider to return a derived class that adds extra functionality such as audit logging each time a connection is used.

I've included an example implementation within the TestWinForm app, so you can add the McTools.Xmr.Connection.TestWinForm.exe assembly as a connection list file and see an example connection.