Esempio n. 1
0
 internal IViewExtension Load(ViewExtensionDefinition viewExtension)
 {
     try
     {
         if (viewExtension.IsEnabled)
         {
             if (viewExtension.RequiresSignedEntryPoint)
             {
                 CertificateVerification.CheckAssemblyForValidCertificate(viewExtension.AssemblyPath);
             }
             var assembly = Assembly.LoadFrom(viewExtension.AssemblyPath);
             var result   = assembly.CreateInstance(viewExtension.TypeName) as IViewExtension;
             ExtensionLoading?.Invoke(result);
             return(result);
         }
         return(null);
     }
     catch (Exception ex)
     {
         var name = viewExtension.TypeName == null ? "null" : viewExtension.TypeName;
         Log("Could not create an instance of " + name);
         Log(ex.Message);
         Log(ex.StackTrace);
         return(null);
     }
 }
Esempio n. 2
0
        private IExtension Load(ExtensionDefinition extension)
        {
            try
            {
                if (extension.RequiresSignedEntryPoint)
                {
                    CertificateVerification.CheckAssemblyForValidCertificate(extension.AssemblyPath);
                }

                var assembly = Assembly.LoadFrom(extension.AssemblyPath);
                var result   = assembly.CreateInstance(extension.TypeName) as IExtension;
                ExtensionLoading?.Invoke(result);

                Logging.Analytics.TrackEvent(
                    Actions.Load,
                    Categories.ExtensionOperations, extension.TypeName);

                return(result);
            }
            catch (Exception ex)
            {
                var name = extension.TypeName == null ? "null" : extension.TypeName;
                Log("Could not create an instance of " + name);
                Log(ex.Message);
                Log(ex.StackTrace);
                return(null);
            }
        }
 private IViewExtension Load(ViewExtensionDefinition viewExtension)
 {
     try
     {
         var assembly = Assembly.LoadFrom(viewExtension.AssemblyPath);
         var result   = assembly.CreateInstance(viewExtension.TypeName) as IViewExtension;
         ExtensionLoading?.Invoke(result);
         return(result);
     }
     catch
     {
         var name = viewExtension.TypeName == null ? "null" : viewExtension.TypeName;
         Log("Could not create an instance of " + name);
         return(null);
     }
 }
 private IExtension Load(ExtensionDefinition extension)
 {
     try
     {
         var assembly = Assembly.LoadFrom(extension.AssemblyPath);
         var result   = assembly.CreateInstance(extension.TypeName) as IExtension;
         ExtensionLoading?.Invoke(result);
         return(result);
     }
     catch (Exception ex)
     {
         var name = extension.TypeName == null ? "null" : extension.TypeName;
         Log("Could not create an instance of " + name);
         Log(ex.Message);
         Log(ex.StackTrace);
         return(null);
     }
 }