public void addTaskBefore(string mes, string id, string name, string auAd, string outCall, string srcAd) { CCOutputInterface outI = tasker.GetOutputList().First(); foreach (CCOutputInterface e in tasker.GetOutputList()) { if (e.getPluginName() == outCall) { outI = e; break; } } tasker.addTaskBefore(mes, id, name, auAd, getPluginName(), srcAd, outI); //addlist.Add(new YomiageTask(mes,id,name,auAd, outI, "LuaSYSTEM",srcAd,-1)); }
public YomiageTask(string mes, string id, string name, string auAd, CCOutputInterface def, string fromsrc, string srcaddinfo, long qnum) { enable = true; message = mes; authorID = id; authorName = name; outputter = def; src = fromsrc; queuenum = qnum; listviewlinkitem = new ListViewItem(new string[7] { "1", "2", "3", "4", "5", "6", "7" }); isDead = false; authorAddinfo = auAd; srcAddinfo = srcaddinfo; Speed = 100; }
private void loadPlugins() { foreach (string dll in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.dll")) { try { System.Reflection.Assembly asm = System.Reflection.Assembly.LoadFile(dll); foreach (Type t in asm.GetTypes()) { if (t.IsClass && t.IsPublic && !t.IsAbstract && t.GetInterface(typeof(CCInputInterface).FullName) != null) { CCInputInterface iplug = (CCInputInterface)asm.CreateInstance(t.FullName); iplug.init(this); inputers.Add(iplug); } if (t.IsClass && t.IsPublic && !t.IsAbstract && t.GetInterface(typeof(CCOutputInterface).FullName) != null) { CCOutputInterface oplug = (CCOutputInterface)asm.CreateInstance(t.FullName); oplug.init(); outputers.Add(oplug); } if (t.IsClass && t.IsPublic && !t.IsAbstract && t.GetInterface(typeof(CCTaskControllInterface).FullName) != null) { CCTaskControllInterface tplug = (CCTaskControllInterface)asm.CreateInstance(t.FullName); tplug.init(this); taskcontrollers.Add(tplug); } } } catch (Exception e) { //System.IO.File.AppendAllText("loadlog.txt", "catch error" + e.Message + "\n"); } } }
public void addTask(string message, string autherID, string autherName, string autherAddinfo, CCInputInterface adder, string adderAddinfo) { CCOutputInterface def = null; if (outputers.Count > 0) { def = outputers[0]; } string srcName = ""; if (adder != null) { srcName = adder.getPluginName(); } YomiageTask ntask = new YomiageTask(message, autherID, autherName, autherAddinfo, def, srcName, adderAddinfo, lastQueueCode++); foreach (CCTaskControllInterface e in taskcontrollers) { e.TaskCheck(ntask, false); } ntask.updateListItem(); queue.Enqueue(ntask); if (taskListv.InvokeRequired) { taskListv.Invoke(new addingTaskDelegate(addingTask), ntask.listviewlinkitem); } else { taskListv.Items.Add(ntask.listviewlinkitem); } afterStackExcute(); //taskListv.Items.Add(ntask.listviewlinkitem); }
public void addTaskTester(string message, string autherID, string autherName, string auAd, string src, string srcAdd, CCOutputInterface outer) { YomiageTask ntask = new YomiageTask(message, autherID, autherName, auAd, outer, src, srcAdd, lastQueueCode++); ntask.updateListItem(); queue.Enqueue(ntask); if (taskListv.InvokeRequired) { taskListv.Invoke(new addingTaskDelegate(addingTask), ntask.listviewlinkitem); } else { taskListv.Items.Add(ntask.listviewlinkitem); } //taskListv.Items.Add(ntask.listviewlinkitem); }
public void addTaskAfter(string message, string autherID, string autherName, string auAd, string src, string srcAdd, CCOutputInterface outer) { YomiageTask ntask = new YomiageTask(message, autherID, autherName, auAd, outer, src, srcAdd, lastQueueCode++); afterAddTasks.Add(ntask); }