public static SealInterface Create(Repository repository)
        {
            SealInterface result = null;
            //Check if an implementation is available in a .dll
            string assembilesFolder = repository.AssembliesFolder;

            if (File.Exists(Path.Combine(assembilesFolder, "SealInterface.dll")))
            {
                try
                {
                    Assembly currentAssembly = AppDomain.CurrentDomain.Load("SealInterface");
                    Type     t    = currentAssembly.GetType("Seal.Model.SealLicenseInterface", true);
                    object[] args = new object[] { };
                    result             = (SealInterface)t.InvokeMember(null, BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance, null, null, args);
                    result._repository = repository;
                }
                catch { }
            }

            if (result == null)
            {
                result = new SealInterface();
            }

            return(result);
        }
Beispiel #2
0
        public static SealInterface Create(Repository repository)
        {
            SealInterface result = null;
            //Check if an implementation is available in a .dll
            string applicationPath = string.IsNullOrEmpty(repository.ApplicationPath) ? Path.GetDirectoryName(Application.ExecutablePath) : repository.ApplicationPath;

            if (File.Exists(Path.Combine(applicationPath, "SealInterface.dll")))
            {
                try
                {
                    Assembly currentAssembly = AppDomain.CurrentDomain.Load("SealInterface");
                    Type     t    = currentAssembly.GetType("Seal.Model.SealLicenseInterface", true);
                    Object[] args = new Object[] { };
                    result             = (SealInterface)t.InvokeMember(null, BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance, null, null, args);
                    result._repository = repository;
                }
                catch { }
            }

            if (result == null)
            {
                result = new SealInterface();
            }

            return(result);
        }
Beispiel #3
0
        public static SealInterface Create(Repository repository)
        {
            SealInterface result = null;
            //Check if an implementation is available in a .dll
            var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "SealInterface.dll");

            if (File.Exists(path))
            {
                if (!_loaded)
                {
                    try
                    {
                        Assembly.LoadFrom(path);
                        _loaded = true;
                    }
                    catch (Exception Exception)
                    {
                        Debug.WriteLine(Exception.Message);
                    }
                }

                try
                {
                    Assembly currentAssembly = AppDomain.CurrentDomain.Load("SealInterface");
                    Type     t    = currentAssembly.GetType("Seal.Model.SealLicenseInterface", true);
                    object[] args = new object[] { };
                    result             = (SealInterface)t.InvokeMember(null, BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance, null, null, args);
                    result._repository = repository;
                }
                catch { }
            }


            if (result == null)
            {
                result = new SealInterface();
            }

            return(result);
        }