コード例 #1
0
        static HostViewModelLocator()
        {
            var customResources = new View.CustomResources();

            customResources.InitializeComponent();

            var commentFactory = new ElementFactory(CustomElementTypeIds.Comment, "Custom", "Comment",
                                                    context => new CommentViewModel(context), typeof(CommentViewModel));

            var functionService = new FunctionService(GetFunctions, GetFunction, EditFunction);

            IRuntimeServiceFactory[] runtimeServiceFactories = new IRuntimeServiceFactory[]
            {
                new MyRuntimeServiceFactory(),
            };

            var factories = new IElementFactory[]
            {
                commentFactory,
            };

            //Create the plugin
            var plugin = new VplPlugin(
                "Host",
                factories,
                new[] { customResources },
                services: new[] { functionService },
                runtimeServiceFactories: runtimeServiceFactories);

            //var plugin1 = new VplPlugin("Alert",
            //    new IElementFactory[]
            //    {
            //        new ElementFactory(new Guid("FBB6804C-B90C-4A88-B28B-8B733C1A9F0D"), "Interaction", "Alert", context => new Alert(context), typeof(Alert)),
            //    });

            var plugins = SystemPluginFactory.CreateAllPlugins()
                          .ToList();

            plugins.Add(plugin);
            //plugins.Add(plugin1);

            //Create the service
            VplService = new VplService(plugins);
        }
コード例 #2
0
        static HostViewModelLocator()
        {
            var customResources = new View.CustomResources();

            customResources.InitializeComponent();

            var commentFactory = new ElementFactory(CustomElementTypeIds.Comment, "Custom", "Comment",
                context => new CommentViewModel(context), typeof(CommentViewModel));

            var functionService = new FunctionService(GetFunctions, GetFunction);

            var factories = new IElementFactory[]
            {
                commentFactory,
            };

            //Create the plugin
            var plugin = new VplPlugin(
                "Host",
                factories,
                new[] { customResources },
                services: new[] { functionService });

            var plugin1 = new VplPlugin("Alert",
                new IElementFactory[]
                {
                    new ElementFactory(new Guid("FBB6804C-B90C-4A88-B28B-8B733C1A9F0D"), "Interaction", "Alert", context => new Alert(context), typeof(Alert)),
                });

            var plugins = SystemPluginFactory.CreateAllPlugins()
                .ToList();

            plugins.Add(plugin);
            plugins.Add(plugin1);

            VplService = new VplService(plugins);
        }