OpenSim/Server/Base/ServerUtils.cs
/// <summary>
/// Load a plugin from a dll with the given class or interface
/// </summary>
/// <param name="dllName"></param>
/// <param name="args">The arguments which control which constructor is invoked on the plugin</param>
/// <returns></returns>
Load a plugin from a dll with the given class or interface
Load a plugin from a dll with the given class or interface
public static T LoadPlugin<T> (string dllName, Object[] args) where T:class
        {
            string className = String.Empty;
            string[] parts = dllName.Split (new char[] {':'});
            if (parts [0].Length > 1) 
            {
                dllName = parts [0];
                if (parts.Length > 1)
                    className = parts[1];
            } 
            else 
            {
                dllName = String.Format ("{0}:{1}", parts [0], parts [1]);
                if (parts.Length > 2)
                    className = parts[2];
            }
            return LoadPlugin<T>(dllName, className, args);
        }
public static T LoadPlugin < T > ( string dllName , Object [ ] args ) where T : class { string className = String . Empty ; string [ ] parts = dllName . Split ( new char [ ] { ' ' } ) ; if ( parts [ 0 ] . Length > 1 ) { dllName = parts [ 0 ] ; if ( parts . Length > 1 ) className = parts [ 1 ] ; } else { dllName = String . Format ( " " , parts [ 0 ] , parts [ 1 ] ) ; if ( parts . Length > 2 ) className = parts [ 2 ] ; } return LoadPlugin < T > ( dllName , className , args ) ; }
Load a plugin from a dll with the given class or interface
Load a plugin from a dll with the given class or interface
// This is good to debug configuration problems //if (dllName == string.Empty) //    Util.PrintCallStack(); // The path for a dynamic plugin will contain ":" on Windows // This is Windows - we must replace the ":" in the path
None
dllName
string
None
args
Object[]
The arguments which control which constructor is invoked on the plugin
The arguments which control which constructor is invoked on the plugin