Ejemplo n.º 1
0
        public static void RegisterEventsAndCommands()
        {
            // register commands and event with serialization

            var commandTypes = typeof(CSharpProjectKernel).Assembly.ExportedTypes
                               .Where(t => !t.IsAbstract && !t.IsInterface)
                               .Where(t => typeof(KernelCommand).IsAssignableFrom(t))
                               .OrderBy(t => t.Name)
                               .ToList();
            var eventTypes = typeof(CSharpProjectKernel).Assembly.ExportedTypes
                             .Where(t => !t.IsAbstract && !t.IsInterface)
                             .Where(t => typeof(KernelEvent).IsAssignableFrom(t))
                             .OrderBy(t => t.Name)
                             .ToList();

            foreach (var commandType in commandTypes)
            {
                KernelCommandEnvelope.RegisterCommand(commandType);
            }

            foreach (var eventType in eventTypes)
            {
                KernelEventEnvelope.RegisterEvent(eventType);
            }
        }
Ejemplo n.º 2
0
 public static TKernel UseVSCodeCommands <TKernel>(this TKernel kernel) where TKernel : Kernel
 {
     kernel.RegisterCommandType <GetInput>();
     KernelCommandEnvelope.RegisterCommand <GetInput>();
     KernelEventEnvelope.RegisterEvent <InputProduced>();
     return(kernel);
 }
Ejemplo n.º 3
0
    static CSharpProjectKernel()
    {
        // register commands and event with serialization
        KernelCommandEnvelope.RegisterCommand <OpenProject>();
        KernelCommandEnvelope.RegisterCommand <OpenDocument>();
        KernelCommandEnvelope.RegisterCommand <CompileProject>();

        KernelEventEnvelope.RegisterEvent <DocumentOpened>();
        KernelEventEnvelope.RegisterEvent <AssemblyProduced>();
    }
Ejemplo n.º 4
0
        public SerializationTests(ITestOutputHelper output)
        {
            _output = output;

            KernelCommandEnvelope.RegisterCommand <OpenProject>();
            KernelCommandEnvelope.RegisterCommand <OpenDocument>();
            KernelCommandEnvelope.RegisterCommand <CompileProject>();
            KernelEventEnvelope.RegisterEvent <DocumentOpened>();
            KernelEventEnvelope.RegisterEvent <AssemblyProduced>();

            KernelCommandEnvelope.RegisterCommand <GetInput>();
            KernelEventEnvelope.RegisterEvent <InputProduced>();
        }