public GameCreationManager(IPluginClient pluginClient, ISerializer serializer)
        {
            this.createGameService = new PluginService<CreateGameClientMessage, GameInviteReceivedServerMessage>(GamifyClientMessageType.CreateGame, GamifyServerMessageType.GameInviteReceived, pluginClient, serializer);
            this.acceptGameService = new PluginService<AcceptGameClientMessage, GameCreatedServerMessage>(GamifyClientMessageType.AcceptGame, GamifyServerMessageType.GameCreated, pluginClient, serializer);
            this.rejectGameService = new PluginService<RejectGameClientMessage, GameRejectedServerMessage>(GamifyClientMessageType.RejectGame, GamifyServerMessageType.GameRejected, pluginClient, serializer);

            this.createGameService.NotificationReceived += (sender, args) =>
            {
                if (this.GameInviteNotificationReceived != null)
                {
                    this.GameInviteNotificationReceived(this, args);
                }
            };

            this.acceptGameService.NotificationReceived += (sender, args) =>
            {
                if (this.GameCreatedNotificationReceived != null)
                {
                    this.GameCreatedNotificationReceived(this, args);
                }
            };

            this.rejectGameService.NotificationReceived += (sender, args) =>
            {
                if (this.GameRejectedNotificationReceived != null)
                {
                    this.GameRejectedNotificationReceived(this, args);
                }
            };
        }
 private async Task ExecutePluginService(IPluginService plugin) {
     try {
         await plugin.Activate();
     } catch (Exception ex) {
         _exceptionHandler.HandleException(ex);
     }
 }
		public bool Init(IPluginService host) {
			if (host == null)
				return false;

			var deps = GetDependencies();
			if (!host.HasPlugins(deps))
				return false;
			
			_host = host;
			IsInitialized = true;
			return true;
		}
Beispiel #4
0
 public ApplicationService(IDocumentSession session, IPageService pageService, ITemplateService templateService,
                           IFolderService folderService,
                           IPluginService pluginService, IMembershipService membershipService,
                           IFormsAuthenticationService formsService)
     : base(session)
 {
     this.pageService = pageService;
     this.pluginService = pluginService;
     this.templateService = templateService;
     this.folderService = folderService;
     this.membershipService = membershipService;
     this.formsService = formsService;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginsService" /> class.
        /// </summary>
        /// <param name="pluginService">The plugin service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="snippetService">The snippet service.</param>
        /// <param name="nugetService">The nuget service.</param>
        public PluginsService(
            IPluginService pluginService,
            ISettingsService settingsService,
            ISnippetService snippetService,
            INugetService nugetService)
        {
            TraceService.WriteLine("PluginsService::Constructor");

            this.pluginService = pluginService;
            this.settingsService = settingsService;
            this.snippetService = snippetService;
            this.nugetService = nugetService;
        }
Beispiel #6
0
 public ContentManager(IApplicationService applicationService, IPageService pageService,
                       IFolderService folderService, ITemplateService templateService,
                       IWidgetService widgetService, IResourceService resourceService,
                       IPluginService pluginService, IMediaService mediaService)
 {
     Application = applicationService;
     Page = pageService;
     Folder = folderService;
     Template = templateService;
     Widget = widgetService;
     Resources = resourceService;
     Plugin = pluginService;
     Media = mediaService;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginsService" /> class.
        /// </summary>
        /// <param name="pluginService">The plugin service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="nugetService">The nuget service.</param>
        /// <param name="codeSnippetFactory">The code snippet factory.</param>
        /// <param name="testingServiceFactory">The testing service factory.</param>
        public PluginsService(
            IPluginService pluginService,
            ISettingsService settingsService,
            INugetService nugetService,
            ICodeSnippetFactory codeSnippetFactory,
            ITestingServiceFactory testingServiceFactory)
        {
            TraceService.WriteLine("PluginsService::Constructor");

            this.pluginService = pluginService;
            this.settingsService = settingsService;
            this.nugetService = nugetService;
            this.codeSnippetFactory = codeSnippetFactory;

            this.testingService = testingServiceFactory.GetTestingService();
            this.codeSnippetService = codeSnippetFactory.GetCodeSnippetService();
        }
        public GameSelectionManager(IPluginClient pluginClient, ISerializer serializer)
        {
            this.openGameService = new PluginService<OpenGameClientMessage, GameInformationReceivedServerMessage>(GamifyClientMessageType.OpenGame, GamifyServerMessageType.GameInformationReceived, pluginClient, serializer);
            this.activeGamesService = new PluginService<GetActiveGamesClientMessage, ActiveGamesListServerMessage>(GamifyClientMessageType.GetActiveGames, GamifyServerMessageType.ActiveGamesList, pluginClient, serializer);
            this.pendingGamesService = new PluginService<GetPendingGamesClientMessage, PendingGamesListServerMessage>(GamifyClientMessageType.GetPendingGames, GamifyServerMessageType.PendingGamesList, pluginClient, serializer);
            this.finishedGamesService = new PluginService<GetFinishedGamesClientMessage, FinishedGamesListServerMessage>(GamifyClientMessageType.GetFinishedGames, GamifyServerMessageType.FinishedGamesList, pluginClient, serializer);

            this.openGameService.NotificationReceived += (sender, args) =>
            {
                if (this.GameInformationNotificationReceived != null)
                {
                    this.GameInformationNotificationReceived(this, args);
                }
            };

            this.activeGamesService.NotificationReceived += (sender, args) =>
            {
                if (this.ActiveGamesNotificationReceived != null)
                {
                    this.ActiveGamesNotificationReceived(this, args);
                }
            };

            this.pendingGamesService.NotificationReceived += (sender, args) =>
            {
                if (this.PendingGamesNotificationReceived != null)
                {
                    this.PendingGamesNotificationReceived(this, args);
                }
            };

            this.finishedGamesService.NotificationReceived += (sender, args) =>
            {
                if (this.FinishedGamesNotificationReceived != null)
                {
                    this.FinishedGamesNotificationReceived(this, args);
                }
            };
        }
        public MainWindow(string[] args)
        {
            InitializeWindow();
            InitializeComponent();

            IServiceProvider serviceProvider = ToolsUIApplication.Instance.RootServiceProvider;
            if (serviceProvider != null)
            {
                this.loggingService = serviceProvider.GetService(typeof(ILoggingService)) as ILoggingService;
                this.notificationService = serviceProvider.GetService(typeof(IUserNotificationService)) as IUserNotificationService;
                this.kstudioService = serviceProvider.GetService(typeof(IKStudioService)) as IKStudioService;
                this.metadataViewService = serviceProvider.GetService(typeof(IMetadataViewService)) as IMetadataViewService;
                this.pluginService = serviceProvider.GetService(typeof(IPluginService)) as IPluginService;
            }

            if (this.kstudioService != null)
            {
                MultiBinding titleBinding = new MultiBinding
                    {
                        Converter = new TitleConverter
                            {
                                NoFileString = Strings.WindowTitle_NoFile,
                                ReadOnlyFileFormat = Strings.WindowTitle_ReadOnlyFileFormat,
                                WritableFileFormat = Strings.WindowTitle_WritableFileFormat,
                            },
                        FallbackValue = ToolsUIApplication.Instance.AppTitle,
                    };

                titleBinding.Bindings.Add(new Binding
                    {
                        Source = this.kstudioService,
                        Path = new PropertyPath("RecordingFilePath"),
                    });
                titleBinding.Bindings.Add(new Binding 
                    { 
                        Source = this.kstudioService,
                        Path = new PropertyPath("PlaybackFilePath"),
                    });
                titleBinding.Bindings.Add(new Binding
                    {
                        Source = this.kstudioService,
                        Path = new PropertyPath("IsPlaybackFileReadOnly"),
                    });

                this.SetBinding(Window.TitleProperty, titleBinding);

                this.kstudioService.PlaybackOpened += (s, e) =>
                    {
                        DebugHelper.AssertUIThread();

                        if (!this.suppressAutoSwitch)
                        {
                            this.SwitchToView("PlaybackableStreamsView");
                        }
                    };

                this.kstudioService.Busy += (s, e) =>
                    {
                        DebugHelper.AssertUIThread();
                        if (e != null)
                        {
                            this.IsEnabled = !e.IsBusy;
                        }
                    };
            }

            if ((args != null) && (this.kstudioService != null))
            {
                if (args.Length > 1)
                {
                    bool connect = false;
                    bool readOnly = false;
                    string fileName = null;

                    for (int i = 1; i < args.Length; ++i)
                    {
                        string arg = args[i];
                        if ((arg.Length > 1) && (arg[0] == '-'))
                        {
                            char ch = Char.ToUpperInvariant(arg[1]);

                            switch (ch)
                            {
                                case 'R':
                                    readOnly = true;
                                    break;
                            }
                        }
                        else
                        {
                            fileName = args[i];
                        }
                    }

                    string error = null;
                    string targetAlias = null;
                    IPAddress targetAddress = null;
                    
                    targetAlias = Environment.MachineName;
                    targetAddress = IPAddress.Loopback;

                    this.Loaded += (s, e) =>
                        {
                            Dispatcher.BeginInvoke(new Action(() =>
                                {
                                    if (error == null)
                                    {
                                        if (connect)
                                        {
                                            if (targetAddress != null)
                                            {
                                                using (WaitCursor waitCursor = new WaitCursor(this))
                                                {
                                                    if (!this.kstudioService.ConnectToTarget(targetAddress, targetAlias))
                                                    {
                                                        fileName = null;
                                                    }
                                                }
                                            }
                                        }

                                        if (fileName != null)
                                        {
                                            error = String.Format(CultureInfo.CurrentCulture, Strings.Arg_Error_InvalidFileName, fileName);

                                            if (fileName.Length > 2)
                                            {
                                                using (WaitCursor waitCursor = new WaitCursor(this))
                                                {
                                                    this.OpenFile(fileName, readOnly);

                                                    error = null;
                                                }
                                            }
                                        }
                                    }

                                    if (error != null)
                                    {
                                        if (this.notificationService != null)
                                        {
                                            this.notificationService.ShowMessageBox(error, MessageBoxButton.OK, MessageBoxImage.Exclamation, MessageBoxResult.OK);
                                        }
                                        else if (this.loggingService != null)
                                        {
                                            this.loggingService.LogLine(error);
                                        }
                                    }

                                    CommandManager.InvalidateRequerySuggested();
                                }
                            ));
                        };
                }
            }
        }
Beispiel #10
0
 public UnattendedResolver(ILogService log, ISettingsService settings, IArgumentsService arguments, IPluginService pluginService)
 {
     _log       = log;
     _plugins   = pluginService;
     _arguments = arguments;
     _settings  = settings;
 }
 protected IrPluginViewSettings(IPluginService pluginService, EventType eventType)
 {
     this.pluginService = pluginService;
     this.eventType = eventType;
 }
Beispiel #12
0
 public LicenseApiService(IPluginService pluginService)
 {
     _pluginService = pluginService;
 }
Beispiel #13
0
 public HomeController(IPluginService pluginService)
 {
     this.pluginService = pluginService;
 }
Beispiel #14
0
 public PluginManager(ICustomerService customerService,
                      IPluginService pluginService)
 {
     _customerService = customerService;
     _pluginService   = pluginService;
 }
Beispiel #15
0
        public static Layer FromLayerEntity(Profile profile, LayerEntity layerEntity, IPluginService pluginService)
        {
            var layer = new Layer(profile)
            {
                Name      = layerEntity.Name,
                Order     = layerEntity.Order,
                LayerType = pluginService.GetLayerTypeByGuid(Guid.Parse(layerEntity.Guid))
            };

            return(layer);
        }
Beispiel #16
0
 public void RegisterPlugin(IPluginService plugin)
 {
     lock (plugins) {
         plugins.Add(plugin);
     }
 }
 public string TestService(IPluginService inputValues)
 {
     return(_updateRepository.TestPluginService(inputValues));
 }
 public AuthenticationPluginManager(ExternalAuthenticationSettings externalAuthenticationSettings,
                                    IPluginService pluginService) : base(pluginService)
 {
     _externalAuthenticationSettings = externalAuthenticationSettings;
 }
 public ShippingPluginManager(IPluginService pluginService,
                              ShippingSettings shippingSettings) : base(pluginService)
 {
     _shippingSettings = shippingSettings;
 }
Beispiel #20
0
 public AssemblyResolver(IPluginService pluginService, IInjectorService injector)
 {
     _pluginService = pluginService;
     _injector      = injector;
 }
 public IrPlugin3DViewSettings(IPluginService pluginService, EventType eventType) :
     base(pluginService, eventType)
 {
 }
Beispiel #22
0
 public void UnregisterPlugin(IPluginService plugin)
 {
     lock (plugins) {
         plugins.Remove(plugin);
     }
 }
 public RawIrPlugin3DViewSettings(IPluginService pluginService, EventType eventType) :
     base(pluginService, eventType)
 {
     this.viewType = RawIr3DViewType.DepthColor;
 }
 public MultiFactorAuthenticationPluginManager(MultiFactorAuthenticationSettings multiFactorAuthenticationSettings,
                                               ICustomerService customerService,
                                               IPluginService pluginService) : base(customerService, pluginService)
 {
     _multiFactorAuthenticationSettings = multiFactorAuthenticationSettings;
 }
 public CommonModelFactory(AdminAreaSettings adminAreaSettings,
                           CatalogSettings catalogSettings,
                           CurrencySettings currencySettings,
                           IActionContextAccessor actionContextAccessor,
                           IAuthenticationPluginManager authenticationPluginManager,
                           IBaseAdminModelFactory baseAdminModelFactory,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           INopDataProvider dataProvider,
                           IDateTimeHelper dateTimeHelper,
                           INopFileProvider fileProvider,
                           IExchangeRatePluginManager exchangeRatePluginManager,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IMaintenanceService maintenanceService,
                           IMeasureService measureService,
                           IOrderService orderService,
                           IPaymentPluginManager paymentPluginManager,
                           IPickupPluginManager pickupPluginManager,
                           IPluginService pluginService,
                           IProductService productService,
                           IReturnRequestService returnRequestService,
                           ISearchTermService searchTermService,
                           IShippingPluginManager shippingPluginManager,
                           IStaticCacheManager staticCacheManager,
                           IStoreContext storeContext,
                           IStoreService storeService,
                           ITaxPluginManager taxPluginManager,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWidgetPluginManager widgetPluginManager,
                           IWorkContext workContext,
                           MeasureSettings measureSettings,
                           NopConfig nopConfig,
                           NopHttpClient nopHttpClient,
                           ProxySettings proxySettings)
 {
     _adminAreaSettings           = adminAreaSettings;
     _catalogSettings             = catalogSettings;
     _currencySettings            = currencySettings;
     _actionContextAccessor       = actionContextAccessor;
     _authenticationPluginManager = authenticationPluginManager;
     _baseAdminModelFactory       = baseAdminModelFactory;
     _currencyService             = currencyService;
     _customerService             = customerService;
     _dataProvider              = dataProvider;
     _dateTimeHelper            = dateTimeHelper;
     _exchangeRatePluginManager = exchangeRatePluginManager;
     _httpContextAccessor       = httpContextAccessor;
     _languageService           = languageService;
     _localizationService       = localizationService;
     _maintenanceService        = maintenanceService;
     _measureService            = measureService;
     _fileProvider              = fileProvider;
     _orderService              = orderService;
     _paymentPluginManager      = paymentPluginManager;
     _pickupPluginManager       = pickupPluginManager;
     _pluginService             = pluginService;
     _productService            = productService;
     _returnRequestService      = returnRequestService;
     _searchTermService         = searchTermService;
     _shippingPluginManager     = shippingPluginManager;
     _staticCacheManager        = staticCacheManager;
     _storeContext              = storeContext;
     _storeService              = storeService;
     _taxPluginManager          = taxPluginManager;
     _urlHelperFactory          = urlHelperFactory;
     _urlRecordService          = urlRecordService;
     _webHelper           = webHelper;
     _widgetPluginManager = widgetPluginManager;
     _workContext         = workContext;
     _measureSettings     = measureSettings;
     _nopConfig           = nopConfig;
     _nopHttpClient       = nopHttpClient;
     _proxySettings       = proxySettings;
 }
Beispiel #26
0
 public TaxPluginManager(ICustomerService customerService,
                         IPluginService pluginService,
                         TaxSettings taxSettings) : base(customerService, pluginService)
 {
     _taxSettings = taxSettings;
 }
        public HomeController(IPluginService service)
        {

            this.plugin = service;
        }
Beispiel #28
0
        public void Initialize(IPluginService pluginService)
        {
            foreach (var plugin in pluginService.Plugins)
            {
                foreach (var assembly in plugin.Assemblies)
                {
                    if (plugin.Assemblies.Any(x => x.FullName == assembly.FullName))
                    {
                        foreach (Type type in assembly.GetTypes())
                        {
                            try
                            {
                                var methods = from method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)
                                              where method.IsDefined(typeof(WebHookAttribute))
                                              select method;

                                foreach (MethodInfo method in methods)
                                {
                                    var arrtibutes = Attribute.GetCustomAttributes(method, false).Where(a => a is WebHookAttribute);
                                    foreach (WebHookAttribute attr in arrtibutes)
                                    {
                                        WebHookInfo whi = new WebHookInfo();
                                        whi.Instance   = new DynamicObjectCreater(type).CreateInstance();
                                        whi.Method     = method;
                                        whi.EntityName = attr.EntityName.ToLowerInvariant();
                                        whi.Name       = attr.Name.ToLowerInvariant();
                                        whi.Priority   = attr.Priority;

                                        Dictionary <string, List <WebHookInfo> > entityHooks;
                                        if (hooks.TryGetValue(whi.EntityName, out entityHooks))
                                        {
                                            List <WebHookInfo> hooksList;
                                            if (entityHooks.TryGetValue(whi.Name, out hooksList))
                                            {
                                                hooksList.Add(whi);
                                            }
                                            else
                                            {
                                                hooksList = new List <WebHookInfo>();
                                                hooksList.Add(whi);
                                                entityHooks.Add(whi.Name, hooksList);
                                            }
                                        }
                                        else
                                        {
                                            entityHooks = new Dictionary <string, List <WebHookInfo> >();
                                            List <WebHookInfo> hooksList = new List <WebHookInfo>();
                                            hooksList.Add(whi);
                                            entityHooks.Add(whi.Name, hooksList);
                                            hooks.Add(whi.EntityName, entityHooks);
                                        }
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                throw new Exception("An exception is thrown while register web hooks for plugin : '" +
                                                    assembly.FullName + ";" + type.Namespace + "." + type.Name + "'", ex);
                            }
                        }
                    }
                }
            }
        }
Beispiel #29
0
 public ArgumentsParser(ILogService log, IPluginService plugins, string[] args)
 {
     _log       = log;
     _args      = args;
     _providers = plugins.OptionProviders();
 }
 public ProductService(IPluginService pluginService) : base(pluginService)
 {
 }
 public EsotericLanguageController(IPluginService svc)
 {
     Service = svc;
 }
Beispiel #32
0
 public IrPlugin3DViewSettings(IPluginService pluginService, EventType eventType) :
     base(pluginService, eventType)
 {
 }
Beispiel #33
0
 public CommonModelFactory(AdminAreaSettings adminAreaSettings,
                           CatalogSettings catalogSettings,
                           CurrencySettings currencySettings,
                           IActionContextAccessor actionContextAccessor,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IDateTimeHelper dateTimeHelper,
                           IExternalAuthenticationService externalAuthenticationService,
                           INopFileProvider fileProvider,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IMaintenanceService maintenanceService,
                           IMeasureService measureService,
                           IOrderService orderService,
                           IPaymentService paymentService,
                           IPluginService pluginService,
                           IProductService productService,
                           IReturnRequestService returnRequestService,
                           ISearchTermService searchTermService,
                           IShippingService shippingService,
                           IStoreContext storeContext,
                           IStoreService storeService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWidgetService widgetService,
                           IWorkContext workContext,
                           MeasureSettings measureSettings,
                           TaxSettings taxSettings)
 {
     _adminAreaSettings             = adminAreaSettings;
     _catalogSettings               = catalogSettings;
     _currencySettings              = currencySettings;
     _actionContextAccessor         = actionContextAccessor;
     _currencyService               = currencyService;
     _customerService               = customerService;
     _dateTimeHelper                = dateTimeHelper;
     _externalAuthenticationService = externalAuthenticationService;
     _fileProvider         = fileProvider;
     _httpContextAccessor  = httpContextAccessor;
     _languageService      = languageService;
     _localizationService  = localizationService;
     _maintenanceService   = maintenanceService;
     _measureService       = measureService;
     _orderService         = orderService;
     _paymentService       = paymentService;
     _pluginService        = pluginService;
     _productService       = productService;
     _returnRequestService = returnRequestService;
     _searchTermService    = searchTermService;
     _shippingService      = shippingService;
     _storeContext         = storeContext;
     _storeService         = storeService;
     _urlHelperFactory     = urlHelperFactory;
     _urlRecordService     = urlRecordService;
     _webHelper            = webHelper;
     _widgetService        = widgetService;
     _workContext          = workContext;
     _measureSettings      = measureSettings;
     _taxSettings          = taxSettings;
 }
Beispiel #34
0
 public string TestService(IPluginService inputValues) => _updateRepository.TestPluginService(inputValues);
Beispiel #35
0
 public PluginLoader(ILog logger, IDirectoryLocator directoryLocator, IPluginRepository pluginRepository, IPluginService pluginService)
 {
     _logger           = logger;
     _directoryLocator = directoryLocator;
     _pluginRepository = pluginRepository;
     _pluginService    = pluginService;
 }
Beispiel #36
0
        public void Initialize(IPluginService pluginService)
        {
            foreach (var plugin in pluginService.Plugins)
            {
                foreach (var assembly in plugin.Assemblies)
                {
                    if (plugin.Assemblies.Any(x => x.FullName == assembly.FullName))
                    {
                        foreach (Type type in assembly.GetTypes())
                        {
                            try
                            {
                                var methods = from method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)
                                              where method.IsDefined(typeof(WebHookAttribute))
                                              select method;

                                foreach (MethodInfo method in methods)
                                {
                                    var arrtibutes = Attribute.GetCustomAttributes(method, false).Where(a => a is WebHookAttribute);
                                    foreach (WebHookAttribute attr in arrtibutes)
                                    {
                                        WebHookInfo whi = new WebHookInfo();
                                        whi.Instance = new DynamicObjectCreater(type).CreateInstance();
                                        whi.Method = method;
                                        whi.EntityName = attr.EntityName.ToLowerInvariant();
                                        whi.Name = attr.Name.ToLowerInvariant();
                                        whi.Priority = attr.Priority;

                                        Dictionary<string, List<WebHookInfo>> entityHooks;
                                        if (hooks.TryGetValue(whi.EntityName, out entityHooks))
                                        {
                                            List<WebHookInfo> hooksList;
                                            if (entityHooks.TryGetValue(whi.Name, out hooksList))
                                                hooksList.Add(whi);
                                            else
                                            {
                                                hooksList = new List<WebHookInfo>();
                                                hooksList.Add(whi);
                                                entityHooks.Add(whi.Name, hooksList);
                                            }
                                        }
                                        else
                                        {
                                            entityHooks = new Dictionary<string, List<WebHookInfo>>();
                                            List<WebHookInfo> hooksList = new List<WebHookInfo>();
                                            hooksList.Add(whi);
                                            entityHooks.Add(whi.Name, hooksList);
                                            hooks.Add(whi.EntityName, entityHooks);
                                        }
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                throw new Exception("An exception is thrown while register web hooks for plugin : '" +
                                    assembly.FullName + ";" + type.Namespace + "." + type.Name + "'", ex);
                            }
                        }
                    }
                }
            }
        }
Beispiel #37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ModuleController"/> class.
 /// </summary>
 public ModuleController()
 {
     pluginService       = ServiceLocator.Current.GetInstance <IPluginService>();
     pluginLocaleService = ServiceLocator.Current.GetInstance <IPluginLocaleService>();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ModuleController"/> class.
 /// </summary>
 public ModuleController()
 {
     pluginService = ServiceLocator.Current.GetInstance<IPluginService>();
     pluginLocaleService = ServiceLocator.Current.GetInstance<IPluginLocaleService>();
 }
Beispiel #39
0
 public PluginManager(IPluginService pluginService)
 {
     _pluginService = pluginService;
 }
Beispiel #40
0
 public ForkMeRibbonSettingsModel(IPluginService pluginService)
 {
     this.pluginService = pluginService;
 }
 public PluginController(IPluginService pluginService, IPluginFileService pluginFileService)
 {
     _pluginService     = pluginService;
     _pluginFileService = pluginFileService;
 }
 public string TestPluginService(IPluginService inputValues) => UpdateManagerProxy.TestPluginService(inputValues);
Beispiel #43
0
 internal StorageService(IPluginService pluginService)
 {
     _pluginService     = pluginService;
     _profileRepository = new ProfileRepository();
 }
Beispiel #44
0
 public PluginsController(IPluginService pluginService, IGuildService guildService, UserManager <User> userManager)
 {
     _pluginService = pluginService;
     _guildService  = guildService;
     _userManager   = userManager;
 }
Beispiel #45
0
        public void Configure(IApplicationBuilder app, IServiceProvider serviceProvider)
        {
            //TODO Create db context
            CultureInfo.DefaultThreadCurrentCulture   = CultureInfo.GetCultureInfo("en-US");
            CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("en-US");
            Settings.Initialize(Configuration);

            try
            {
                DbContext.CreateContext(Settings.ConnectionString);

                IErpService service = app.ApplicationServices.GetService <IErpService>();
                AutoMapperConfiguration.Configure();
                service.InitializeSystemEntities();

                app.UseErpMiddleware();

                //IHostingEnvironment env = app.ApplicationServices.GetService<IHostingEnvironment>();
                //if (env.IsDevelopment())
                app.UseDeveloperExceptionPage();

                IPluginService      pluginService      = app.ApplicationServices.GetService <IPluginService>();
                IHostingEnvironment hostingEnvironment = app.ApplicationServices.GetRequiredService <IHostingEnvironment>();
                pluginService.Initialize(serviceProvider);

                IWebHookService webHookService = app.ApplicationServices.GetService <IWebHookService>();
                webHookService.Initialize(pluginService);

                NotificationContext.Initialize();
                NotificationContext.Current.SendNotification(new Notification {
                    Channel = "*", Message = "ERP configuration loaded and completed."
                });
            }
            finally
            {
                DbContext.CloseContext();
            }

            //Enable CORS
            //app.Use((context, next) =>
            //{
            //	context.Response.Headers.Add("Access-Control-Allow-Origin", new[] { "*" });
            //	context.Response.Headers.Add("Access-Control-Allow-Headers", new[] { "*" });
            //	context.Response.Headers.Add("Access-Control-Allow-Methods", new[] { "*" });
            //	return next();
            //});

            //app.Run(async context =>
            //{
            //    IErpService service = app.ApplicationServices.GetService<IErpService>();
            //    service.Run();
            //    context.Response.ContentType = "text/html";
            //    context.Response.StatusCode = 200;
            //    System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
            //    byte[] buffer = encoding.GetBytes("<h1>test</h1>");
            //    await context.Response.Body.WriteAsync(buffer, 0, buffer.Length);
            //});

            // Add the following to the request pipeline only in development environment.
            if (string.Equals(hostingEnviroment.EnvironmentName, "Development", StringComparison.OrdinalIgnoreCase))
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // Add Error handling middleware which catches all application specific errors and
                // send the request to the following path or controller action.
                app.UseExceptionHandler("/Home/Error");
            }

            //TODO Check what was done here in RC1
            //app.UseIISPlatformHandler(options => options.AutomaticAuthentication = false);

            // Add static files to the request pipeline.
            app.UseStaticFiles();

            // Add MVC to the request pipeline.
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action}/{id?}",
                    defaults: new { controller = "Home", action = "Index" });

                // Uncomment the following line to add a route for porting Web API 2 controllers.
                // routes.MapWebApiRoute("DefaultApi", "api/{controller}/{id?}");
            });
        }
Beispiel #46
0
 public PickupPluginManager(ICustomerService customerService,
                            IPluginService pluginService,
                            ShippingSettings shippingSettings) : base(customerService, pluginService)
 {
     _shippingSettings = shippingSettings;
 }
Beispiel #47
0
 /// <summary>
 /// Initializes a new instance of <see cref="Bootstrapper"/>.
 /// </summary>
 protected Bootstrapper()
 {
     _resolver = DependencyResolver.Current;
     _pluginService = new DefaultPluginService();
 }
Beispiel #48
0
        private void AddSubMenuItem(SinoMenuItem _fmenuitem, List <SinoMenuItem> _menuList, FrmMenuGroup _fmg)
        {
            //SinoMenuFatherFinder _finder = new SinoMenuFatherFinder(_fmenuitem.MenuID);
            //List<SinoMenuItem> _subMenuList = _menuList.FindAll(new Predicate<SinoMenuItem>(_finder.FindByFather));
            //_subMenuList.Sort(new SinoMenuComparer());

            var _subMenuList = from _c in _menuList
                               where _c.FatherID == _fmenuitem.MenuID
                               orderby _c.DisplayOrder
                               select _c;

            foreach (SinoMenuItem _smi in _subMenuList)
            {
                if (_smi.CanUse)
                {
                    FrmMenuItem _mitem = null;
                    if (_smi.MenuType == "")
                    {
                        _mitem = new FrmMenuItem(_smi.MenuID, _smi.MenuTitle, "", global::SinoSZClientBase.Properties.Resources.foward2, _smi.CanUse, null);
                    }
                    else
                    {
                        #region  类型定义

                        string[] _typeStrs = _smi.MenuType.Split('.');
                        if (_typeStrs.Length > 1)
                        {
                            string         _pluginName   = _typeStrs[0];
                            string         _commandName  = _typeStrs[1];
                            IPluginService pluginService = (IPluginService)application.GetService(typeof(IPluginService));
                            IPlugin        _plugin       = pluginService.GetPluginInstance(_pluginName);
                            if (_plugin == null)
                            {
                                RaiseLoadErrord(new CommonEventArgs(string.Format("未找到菜单定义用的插件:{0}", _pluginName)));
                                _mitem = new FrmMenuItem(_smi.MenuID, _smi.MenuTitle, "", global::SinoSZClientBase.Properties.Resources.foward2, _smi.CanUse, null);
                            }
                            else
                            {
                                _mitem = _plugin.GetMenuItem(_commandName, _smi.MenuTitle, _smi.MenuParameter);
                                if (_mitem == null)
                                {
                                    RaiseLoadErrord(new CommonEventArgs(string.Format("插件{1}中未找到菜单定义用的:{0}", _commandName, _pluginName)));
                                    _mitem = new FrmMenuItem(_smi.MenuID, _smi.MenuTitle, "", global::SinoSZClientBase.Properties.Resources.foward2, _smi.CanUse, null);
                                }
                                else
                                {
                                    _mitem.MenuID = _smi.MenuID;
                                }
                            }
                        }
                        #endregion
                    }

                    if (_mitem != null)
                    {
                        MenuDict.Add(_smi.MenuID, _mitem);
                        if (_smi.IconName != "-1")
                        {
                            Image _mIcon = SinoSZResources.GetIcon(_smi.IconName);
                            if (_mIcon != null)
                            {
                                _mitem.MenuIcon = _mIcon;
                            }
                        }
                        this.AddMenuItem(_fmg, _mitem);
                        _mitem.ChildMenus = CreateChildItems(_mitem, _menuList);
                    }
                }
            }
        }