Ejemplo n.º 1
0
 /// <summary>
 /// Gets the registration status.
 /// </summary>
 /// <param name="feature">The feature.</param>
 /// <param name="mb2Equivalent">The MB2 equivalent.</param>
 /// <returns>Task{MBRegistrationRecord}.</returns>
 public async Task <MBRegistrationRecord> GetRegistrationStatus(string feature, string mb2Equivalent = null)
 {
     // Do this on demend instead of in the constructor to delay the external assembly load
     // Todo: Refactor external methods to take app paths as a param
     MBRegistration.Init(_applciationPaths, _networkManager);
     return(await MBRegistration.GetRegistrationStatus(_httpClient, _jsonSerializer, feature, mb2Equivalent).ConfigureAwait(false));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginSecurityManager" /> class.
        /// </summary>
        public PluginSecurityManager(IApplicationHost appHost, IHttpClient httpClient, IJsonSerializer jsonSerializer, IApplicationPaths appPaths)
        {
            if (httpClient == null)
            {
                throw new ArgumentNullException("httpClient");
            }

            _appHost        = appHost;
            _httpClient     = httpClient;
            _jsonSerializer = jsonSerializer;
            MBRegistration.Init(appPaths);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginSecurityManager" /> class.
        /// </summary>
        public PluginSecurityManager(IApplicationHost appHost, IHttpClient httpClient, IJsonSerializer jsonSerializer,
                                     IApplicationPaths appPaths, INetworkManager networkManager, ILogManager logManager)
        {
            if (httpClient == null)
            {
                throw new ArgumentNullException("httpClient");
            }

            _applciationPaths = appPaths;
            _networkManager   = networkManager;
            _appHost          = appHost;
            _httpClient       = httpClient;
            _jsonSerializer   = jsonSerializer;
            MBRegistration.Init(_applciationPaths, _networkManager, logManager, _appHost);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the registration status.
 /// This overload supports existing plug-ins.
 /// </summary>
 /// <param name="feature">The feature.</param>
 /// <param name="mb2Equivalent">The MB2 equivalent.</param>
 /// <returns>Task{MBRegistrationRecord}.</returns>
 public async Task <MBRegistrationRecord> GetRegistrationStatus(string feature, string mb2Equivalent = null)
 {
     return(await MBRegistration.GetRegistrationStatus(_httpClient, _jsonSerializer, feature, mb2Equivalent).ConfigureAwait(false));
 }