public object[] GetAllItemsWithInterface <T>() where T : class
        {
            var helper = DomainHelper.GetHelper <IDomainHelper>(Domain);// GetDomainHelper();
            var items  = helper.GetAllItemsWithInterface <T>();

            return(items);
        }
        public T CreateInstanceAndUnwrap <T>(string assemblyName, string typeName)
        {
            var helper = DomainHelper.GetHelper <IDomainHelper>(Domain);// GetDomainHelper();
            var result = helper.CreateInstanceAndUnwrap <T>(assemblyName, typeName);

            return(result);
        }
 protected void LoadAssemblies(params string[] assemblyNames)
 {
     if (assemblyNames?.Length > 0)
     {
         var helper = DomainHelper.GetHelper <IDomainHelper>(Domain);// GetDomainHelper();
         foreach (var assembly in assemblyNames)
         {
             helper.Load(assembly);
         }
     }
 }
        protected void OnDispose()
        {
            var helper = DomainHelper.GetHelper <IDomainHelper>(Domain);// GetDomainHelper();

            helper?.Dispose();
            if (Domain != null)
            {
                try
                {
                    AppDomain.Unload(Domain);
                }
                catch (CannotUnloadAppDomainException e)
                {
                    Log.e(e);
                }
            }
            Domain = null;
        }
 public CustomAppDomain(string name, string personalPath, bool shadowCopyFiles, bool autoloadAllDlls = true) : this(name, personalPath, shadowCopyFiles, null)
 {
     try
     {
         if (autoloadAllDlls)
         {
             using (var helper = DomainHelper.GetHelper <IDomainHelper>(Domain))
             {
                 foreach (var filename in System.IO.Directory.GetFiles(personalPath))
                 {
                     if (System.IO.Path.GetExtension(filename).ToLower().Equals(".dll"))
                     {
                         helper.Load(filename);
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         Log.e(e);
     }
 }
        public object ExecuteStaticMethod(string assemblyName, string typeName, string methodName, params object[] args)
        {
            var helper = DomainHelper.GetHelper <IDomainHelper>(Domain);// GetDomainHelper();

            return(helper.ExecuteStaticMethod(assemblyName, typeName, methodName, args));
        }
        public int ExecuteAssemblyByName <T>(string assemblyName, params string[] args)
        {
            var helper = DomainHelper.GetHelper <IDomainHelper>(Domain);// GetDomainHelper();

            return(helper.ExecuteAssemblyByName(assemblyName, args));
        }