Beispiel #1
0
        async void UnLoadComponents(object parameter)
        {
            var pluginLoader = AppServiceLocator.GetService <IPluginLoader <IAppComponent> >();
            await pluginLoader.Unload();

            Components = new List <string>();
            this.RaisePropertyChanged(nameof(Components));
        }
Beispiel #2
0
        void UnLoadComponents(object parameter)
        {
            var pluginLoader = AppServiceLocator.GetService <IPluginLoader>();

            pluginLoader.UnloadAll();
            CurrentControl = null;
            Components     = new List <string>();
            this.RaisePropertyChanged(nameof(CurrentControl));
            this.RaisePropertyChanged(nameof(Components));
        }
        // GET: api/Initial
        public UserProfile Get()
        {
            UserProfile result = new UserProfile();

            var temp = AppServiceLocator.GetService <IRepairAttr>();



            return(result);
        }
Beispiel #4
0
        async void LoadComponents(object parameter)
        {
            var pluginLoader = AppServiceLocator.GetService <IPluginLoader <IAppComponent> >();
            var plugins      = await pluginLoader.LoadAll();

            components = new Dictionary <string, IAppComponent>();
            foreach (var plugin in plugins)
            {
                components.Add(plugin.GetName(), plugin);
            }
            Components = new List <string>(components.Select(p => p.Key));
            this.RaisePropertyChanged(nameof(Components));
        }
Beispiel #5
0
        async void LoadComponents(object parameter)
        {
            var pluginLoader      = AppServiceLocator.GetService <IPluginLoader>();
            var dist              = GetPathToComponentsPublishDirectory();
            var pluginScanResults = await pluginLoader.FindPlugins <IAppComponent>(dist);

            components = new Dictionary <string, IAppComponent>();
            foreach (var pluginScanResult in pluginScanResults)
            {
                var plugin = await pluginLoader.LoadPlugin <IAppComponent>(pluginScanResult, configure : (ctx) =>
                {
                    ctx
                    .AddHostTypes(new[] { typeof(Application) })
                    ;
                });

                components.Add(plugin.GetName(), plugin);
            }
            Components = new List <string>(components.Select(p => p.Key));
            this.RaisePropertyChanged(nameof(Components));
        }
Beispiel #6
0
 private void InitializeComponent()
 {
     AvaloniaXamlLoader.Load(this);
     this.DataContext = AppServiceLocator.GetService <MainWindowViewModel>();
 }