Esempio n. 1
0
        public UnitTestMef()
        {
            var root       = Assembly.GetAssembly(typeof(UnitTestMef)).Location;
            var dir        = Path.GetDirectoryName(root);
            var components = dir;
            var dd         = Programs.ProgramsRepository;

            //  var components = Path.Combine(dir, "components");
            CommandCompositionHelper = new CommandCompositionHelper(components);
            CommandCompositionHelper.AssembleCommandComponents();
            CommandCompositionHelper.Initialize();
        }
        public UnitTest1()
        {
            CommandAssemblysLoader.EntryAssembly = Assembly.GetAssembly(typeof(UnitTestMef));
            Anchors.Add(ProgramsCommand.Anchor.FullName);
            var root       = Assembly.GetAssembly(typeof(UnitTestMef)).Location;
            var dir        = Path.GetDirectoryName(root);
            var components = dir;
            var dd         = Programs.ProgramsRepository;

            //  var components = Path.Combine(dir, "components");
            CommandCompositionHelper = new CommandCompositionHelper(components);
            CommandCompositionHelper.AssembleCommandComponents();
            CommandCompositionHelper.Initialize();
        }
Esempio n. 3
0
        public static void Initialize()
        {
            if (CommandCompositionHelper == null)
            {
                var root       = Assembly.GetAssembly(typeof(Startup)).Location;
                var dir        = Path.GetDirectoryName(root);
                var components = dir;

                //  var components = Path.Combine(dir, "components");
                CommandCompositionHelper = new CommandCompositionHelper(components);
                CommandCompositionHelper.AssembleCommandComponents();
                CommandCompositionHelper.Initialize();
                JsonFile.RootFolder = ""; // just making sure that the dll gets copied
            }
        }
Esempio n. 4
0
        public void Initialize()
        {
            if (CommandCompositionHelper == null)
            {
                Anchors.Add(ProgramsCommand.Anchor.FullName);
                Anchors.Add(CommandFileLoader.Anchor.FullName);
                Anchors.Add(CommandPOCCallbacks.Anchor.FullName);
                Anchors.Add(SimpleCommands.Anchor.FullName);
                Anchors.Add(CommandGraphQL.Anchor.FullName);

                P7.GraphQLCore.Global.EntryAssembly  = Assembly.GetAssembly(typeof(Local));
                CommandAssemblysLoader.EntryAssembly = P7.GraphQLCore.Global.EntryAssembly;

                var builder = new ContainerBuilder();

                // Register individual components
                var assemblies = TypeHelper <Local> .GetReferencingAssemblies(P7.GraphQLCore.Global.EntryAssembly);

                builder.RegisterAssemblyModules(assemblies.ToArray());

                TheContainer = builder.Build();
                CommandGraphQL.GraphQLCommands.TheContainer = TheContainer;



                //            var dd = ProgramsCommand.Anchor.Name;
                var root       = Assembly.GetAssembly(typeof(Local)).Location;
                var dir        = Path.GetDirectoryName(root);
                var components = dir;
                //      var dd = ProgramsCommand.Programs.ProgramsRepository;
                //  var components = Path.Combine(dir, "components");
                CommandCompositionHelper = new CommandCompositionHelper(components);
                CommandCompositionHelper.AssembleCommandComponents();
                CommandCompositionHelper.Initialize();


                //       JsonFile.RootFolder = ""; // just making sure that the dll gets copied
            }
        }