//public List<Assembly> Assemblies { set; get; } public XapDownloader(int count) { _overalModuleCount = count; _loadedAssemblies = new List<Assembly>(); _countModulesToLoad = 0; _assemblySource = IoC.Get<IAssemblySource>(); }
public ModuleLoadService(IServiceLocator serviceLocator, IAssemblySource assemblySource, IAssemblyStorageService assemblyStorageService,ErrorService errorService, IGlobalSettingsService globalSettingsService) { _serviceLocator = serviceLocator; _assemblySource = assemblySource; _assemblyStorageService = assemblyStorageService; _errorService = errorService; _globalSettingsService = globalSettingsService; }
/// <summary> /// Initializes a new instance of the <see cref="PluginExtractor"/> class. /// </summary> /// <param name="assemblySource">The assembly source.</param> /// <exception cref="System.ArgumentNullException">assemblySource</exception> public PluginExtractor(IAssemblySource assemblySource) { if (assemblySource == null) throw new ArgumentNullException("assemblySource"); this.InitLog(); this.assemblyPlugins = new Dictionary<string, PluginDescriptor[]>(); assemblySource.AssemblyAdded += new EventHandler<AssemblyAddedEventArgs>(OnAssemblyAdded); assemblySource.AssemblyRemoved += new EventHandler<AssemblyRemovedEventArgs>(OnAssemblyRemoved); }
public ModulesDownload(IEnumerable<ModuleInfo> moduleInfos) { _modulesToLoad = new List<ModuleInfo>(moduleInfos); _countModulesToLoad = 0; _assemblySource = IoC.Get<IAssemblySource>(); _assemblySource.AssemblyAdded += (x => { _countModulesToLoad++; if (_modulesToLoad.Count == _countModulesToLoad) { LoadCompleted(null, new EventArgs()); } }); }
public Assembly Generate(IAssemblySource assemblySource, CompilerParameters compilerParameters) { var stopwatch = Stopwatch.StartNew(); compilerParameters.ReferencedAssemblies.AddRange(assemblySource.RegisteredReferences.ToArray()); if (compilerParameters.WarningLevel == -1) compilerParameters.WarningLevel = 4; string sourceFile = null; CompilerResults results; if (compilerParameters.GenerateInMemory) { using (CSharpCodeProvider codeProvider = new CSharpCodeProvider()) results = codeProvider.CompileAssemblyFromSource(compilerParameters, assemblySource.GeneratedCode); } else { sourceFile = Path.GetFullPath(Path.ChangeExtension(compilerParameters.OutputAssembly, ".cs")); File.WriteAllText(sourceFile, assemblySource.GeneratedCode); using (CSharpCodeProvider codeProvider = new CSharpCodeProvider()) results = codeProvider.CompileAssemblyFromFile(compilerParameters, sourceFile); } _performanceLogger.Write(stopwatch, "CSharpCodeProvider.CompileAssemblyFromSource"); if (results.Errors.HasErrors) throw new FrameworkException(ReportErrors(results, assemblySource.GeneratedCode, sourceFile)); try { results.CompiledAssembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { throw new FrameworkException(CsUtility.ReportTypeLoadException(ex, "Error while compiling " + compilerParameters.OutputAssembly + "."), ex); } ReportWarnings(results, sourceFile); return results.CompiledAssembly; }
public Assembly Generate(IAssemblySource assemblySource, CompilerParameters compilerParameters) { compilerParameters.ReferencedAssemblies.AddRange(assemblySource.RegisteredReferences.ToArray()); var stopwatch = Stopwatch.StartNew(); CompilerResults results; string sourceFile = null; if (compilerParameters.GenerateInMemory) { using (CSharpCodeProvider codeProvider = new CSharpCodeProvider()) results = codeProvider.CompileAssemblyFromSource(compilerParameters, assemblySource.GeneratedCode); } else { sourceFile = Path.GetFullPath(Path.ChangeExtension(compilerParameters.OutputAssembly, ".cs")); File.WriteAllText(sourceFile, assemblySource.GeneratedCode); using (CSharpCodeProvider codeProvider = new CSharpCodeProvider()) results = codeProvider.CompileAssemblyFromFile(compilerParameters, sourceFile); } _performanceLogger.Write(stopwatch, "CSharpCodeProvider.CompileAssemblyFromSource"); if (results.Errors.HasErrors) throw new FrameworkException(GetErrorDescription(results, assemblySource.GeneratedCode, sourceFile)); try { results.CompiledAssembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { if (ex.LoaderExceptions.Any()) LogAndRethrowLoaderExceptions(ex); else throw; } return results.CompiledAssembly; }
/// <summary> /// Initializes a new instance of the <see cref="DefaultViewLocator"/> class. /// </summary> /// <param name="assemblySource">The assembly source.</param> /// <param name="serviceLocator">The service locator.</param> public DefaultViewLocator(IAssemblySource assemblySource, IServiceLocator serviceLocator) { this.assemblySource = assemblySource; this.serviceLocator = serviceLocator; }
public DefaultHistoryCoordinator(IStateManager stateManager, IAssemblySource assemblySource) { this.stateManager = stateManager; this.assemblySource = assemblySource; }
/// <summary> /// Initializes a new instance of the <see cref="DefaultViewStrategy"/> class. /// </summary> /// <param name="assemblySource">The assembly source.</param> /// <param name="serviceLocator">The service locator.</param> public DefaultViewStrategy(IAssemblySource assemblySource, IServiceLocator serviceLocator) { _assemblySource = assemblySource; _serviceLocator = serviceLocator; }
public NavigationWindowLocator(IAssemblySource assemblySource, IServiceLocator serviceLocator) : base(assemblySource, serviceLocator) { }
public HistoryCoordinator(IStateManager stateManager, IAssemblySource assemblySource) { _stateManager = stateManager; _assemblySource = assemblySource; }
public ViewStrategy(IAssemblySource assemblySource, IServiceLocator serviceLocator) : base(assemblySource, serviceLocator) { }