Rewrite Bot-Utils so that handlers are threaded

Tiny fix in INIReader
This commit is contained in:
BlubbFish 2018-09-11 07:59:10 +00:00
parent 9fe7e92915
commit d28a30731b
3 changed files with 12 additions and 2 deletions

1
Bot.cs
View File

@ -79,6 +79,7 @@ namespace BlubbFish.Utils.IoT.Bots {
protected void ModulEvents() {
foreach (KeyValuePair<String, AModul<T>> item in this.moduls) {
item.Value.EventLibSetter();
item.Value.Update += this.ModulUpdate;
}
}

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading;
using BlubbFish.Utils.IoT.Bots.Events;
namespace BlubbFish.Utils.IoT.Bots.Moduls {
@ -49,6 +50,14 @@ namespace BlubbFish.Utils.IoT.Bots.Moduls {
public virtual void SetInterconnection(String param, Action<Object> hook, Object data) { }
public abstract void EventLibSetter();
protected abstract void LibUpadteThread(Object state);
protected void HandleLibUpdate(Object sender, EventArgs e) {
ThreadPool.QueueUserWorkItem(this.LibUpadteThread, e);
}
public abstract void Dispose();
public void SetConfig(Dictionary<String, Dictionary<String, String>> newconf) {

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]