示例#1
0
        public TaskManager(ModulePacket packet)
        {
            _packet = packet;
            _tasks  = _packet.GetInstances().OfType <ITask>();

            // excuse this shit

            _startupTasks    = _tasks.Where((x) => x.Schedule == TaskSchedule.Startup).OrderBy(task => task.Priority).ToArray();
            _backgroundTasks = _tasks.Where((x) => x.Schedule == TaskSchedule.Background).OrderBy(task => task.Priority).ToArray();

            _windowRenderTasks    = _tasks.Where((x) => x.Schedule == TaskSchedule.WindowRender).OrderBy(task => task.Priority).ToArray();
            _windowUpdateTasks    = _tasks.Where((x) => x.Schedule == TaskSchedule.WindowUpdate).OrderBy(task => task.Priority).ToArray();
            _windowResizeTasks    = _tasks.Where((x) => x.Schedule == TaskSchedule.WindowResize).OrderBy(task => task.Priority).ToArray();
            _windowEnterTextTasks = _tasks.Where((x) => x.Schedule == TaskSchedule.WindowEnterText).OrderBy(task => task.Priority).ToArray();
            _windowScrollTasks    = _tasks.Where((x) => x.Schedule == TaskSchedule.WindowMouseScroll).OrderBy(task => task.Priority).ToArray();
            _windowDisposingTasks = _tasks.Where((x) => x.Schedule == TaskSchedule.WindowDisposing).OrderBy(task => task.Priority).ToArray();

            _windowReadyTasks = _tasks.Where((x) => x.Schedule == TaskSchedule.WindowReady).OrderBy(task => task.Priority).ToArray();
        }
示例#2
0
 public Parser(ModulePacket packet)
 {
     _commands = packet.GetInstances().OfType <ICommand>().ToList();
 }
示例#3
0
 public IOManager(ModulePacket packet)
 {
     _packet    = packet;
     _exporters = (List <IExporter>)_packet.GetInstances().OfType <IExporter>();
     _importers = (List <IImporter>)_packet.GetInstances().OfType <IImporter>();
 }