private T TryInstantiate <T>(Type loadedType, IFileSystemCallback fsCallback) where T : class { Type t = typeof(T); Type inter = loadedType.GetInterface(t.Name); if (inter != null) { ConstructorInfo cti = loadedType.GetConstructor(new Type[] { typeof(IFileSystemCallback) }); if (cti != null) { object o = cti.Invoke(new object[] { fsCallback }); return(o as T); } } return(default(T)); }
public SftpFileSystem(IFileSystemCallback callback) { _logger = callback.GetLogger(); CredentialsCache = new CredentialCache(); }