/// <summary>
        /// For each assembly specified, detect the .net runtime the dll is targeting
        /// </summary>
        /// <param name="runnerAssemblies"></param>
        /// <returns></returns>
        private Dictionary <string, FrameworkType> DetectRunnersFromAssemblies(string runnerAssemblies)
        {
            OnScanStarted?.Invoke();
            var assemblyMetadata = new Dictionary <string, FrameworkType>();

            // load all of the assemblies and inspect them
            foreach (var assemblyPath in runnerAssemblies.Split(" ", StringSplitOptions.RemoveEmptyEntries))
            {
                var fullpath = assemblyPath;
                assemblyMetadata.Add(fullpath, PortableExecutableHelper.GetAssemblyFrameworkType(fullpath));
            }
            OnScanCompleted?.Invoke();
            return(assemblyMetadata);
        }
Exemple #2
0
 internal void _OnScanStarted(LibraryType _Library)
 {
     OnScanStarted?.Invoke(this, _Library);
     Utils.Call("self.EventStarted = False");
 }
        public bool TriggerEvent(KodiEventMessage e)
        {
            switch (e.Source)
            {
            case "onAbortRequested":
                OnAbortRequested?.Invoke(null, new EventArgs());
                break;

            case "onCleanStarted":
                OnCleanStarted?.Invoke(null, new LibraryEventArgs(e.EventArgs[0]));
                break;

            case "onCleanFinished":
                OnCleanFinished?.Invoke(null, new LibraryEventArgs(e.EventArgs[0]));
                break;

            case "onDPMSActivated":
                OnDPMSActivated?.Invoke(null, new EventArgs());
                break;

            case "onDPMSDeactivated":
                OnDPMSDeactivated?.Invoke(null, new EventArgs());
                break;

            case "onDatabaseScanStarted":
                OnDatabaseScanStarted?.Invoke(null, new DatabaseEventArgs(e.EventArgs[0]));
                break;

            case "onDatabaseUpdated":
                OnDatabaseUpdated?.Invoke(null, new DatabaseEventArgs(e.EventArgs[0]));
                break;

            case "onNotification":
                OnNotification?.Invoke(null, new NotificationEventArgs(
                                           e.EventArgs[0], e.EventArgs[1], e.EventArgs[2]
                                           ));
                break;

            case "onScanStarted":
                OnScanStarted?.Invoke(null, new LibraryEventArgs(e.EventArgs[0]));
                break;

            case "onScanFinished":
                OnScanFinished?.Invoke(null, new LibraryEventArgs(e.EventArgs[0]));
                break;

            case "onScreensaverActivated":
                OnScreensaverActivated?.Invoke(null, new EventArgs());
                break;

            case "onScreensaverDeactivated":
                OnScreensaverDeactivated?.Invoke(null, new EventArgs());
                break;

            case "onSettingsChanged":
                OnSettingsChanged?.Invoke(null, new EventArgs());
                break;

            default:
                PyConsole.WriteLine(string.Format("Unknown event '{0}' not handled", e.Source));
                return(false);
            }
            return(true);
        }