public LoginSoapService(IXellentAPI client, IConnectService connectService, IConfig config, IMeterReadingSoapService meterReadingService)
 {
     _client              = client;
     _config              = config;
     _connectService      = connectService;
     _meterReadingService = meterReadingService;
 }
Beispiel #2
0
 public PodcastViewModel(IPodcastService podcastService, IDialogService dialogService, IConnectService connectService, IRadioPlayer radioPlayer)
 {
     _podcastService = podcastService;
     _dialogService  = dialogService;
     _connectService = connectService;
     _radioPlayer    = radioPlayer;
 }
 public ConnectController(IConnectService connectService,
                          UserManager <User> userManager,
                          ILogger <ConnectController> logger)
     : base(userManager)
 {
     this.logger            = logger;
     this.connectService    = connectService;
     this.CurrentController = this.GetType().Name;
 }
        public ConnectServiceTests()
        {
            var services = new ServiceCollection();

            services.AddDbContext <ApplicationDbContext>(opt =>
                                                         opt.UseInMemoryDatabase(Guid.NewGuid().ToString()));
            services.AddScoped <IConnectService, ConnectService>();
            services.AddScoped(typeof(IRepository <>), typeof(Repository <>));
            AutoMapperConfig.RegisterMappings(
                typeof(ErrorViewModel).Assembly
                );

            this.provider        = services.BuildServiceProvider();
            this.context         = provider.GetService <ApplicationDbContext>();
            this.service         = provider.GetService <IConnectService>();
            this.albumRepository = provider.GetService <IRepository <Album> >();
            this.routeRepository = provider.GetService <IRepository <Route> >();
            this.storyRepository = provider.GetService <IRepository <Story> >();
        }
Beispiel #5
0
        /// <summary>重新加载</summary>
        private void Reload()
        {
            if (this.restartCount > 0)
            {
                KernelContext.Log.Info(string.Format(I18n.Strings["application_is_reloading"], ConnectConfiguration.ApplicationName));

                // 重新加载配置信息
                ConnectConfigurationView.Instance.Reload();
            }
            else
            {
                KernelContext.Log.Info(string.Format(I18n.Strings["application_is_loading"], ConnectConfiguration.ApplicationName));
            }

            // 创建对象构建器(Spring.NET)
            string springObjectFile = ConnectConfigurationView.Instance.Configuration.Keys["SpringObjectFile"].Value;

            SpringObjectBuilder objectBuilder = SpringObjectBuilder.Create(ConnectConfiguration.ApplicationName, springObjectFile);

            // 创建数据服务对象
            this.m_ConnectService                  = objectBuilder.GetObject <IConnectService>(typeof(IConnectService));
            this.m_ConnectAccessTokenService       = objectBuilder.GetObject <IConnectAccessTokenService>(typeof(IConnectAccessTokenService));
            this.m_ConnectAuthorizationCodeService = objectBuilder.GetObject <IConnectAuthorizationCodeService>(typeof(IConnectAuthorizationCodeService));
            this.m_ConnectCallService              = objectBuilder.GetObject <IConnectCallService>(typeof(IConnectCallService));

            // -------------------------------------------------------
            // 设置定时器
            // -------------------------------------------------------

            // 由数据库来定时任务来清理过期会话
            timer.Enabled = true;

            timer.Interval = ConnectConfigurationView.Instance.SessionTimerInterval * 60 * 1000;

            timer.Elapsed += delegate(object sender, ElapsedEventArgs e)
            {
                ConnectContext.Instance.ConnectAccessTokenService.Clear(DateTime.Now.AddHours(-ConnectConfigurationView.Instance.SessionTimeLimit));
            };

            timer.Start();

            KernelContext.Log.Info(string.Format(I18n.Strings["application_is_successfully_loaded"], ConnectConfiguration.ApplicationName));
        }
Beispiel #6
0
        public ConnectToPersonDialogViewModel()
        {
            navigationService = (Application.Current as App)?.Container.Resolve <INavigationService>();
            connectService    = (Application.Current as App)?.Container.Resolve <IConnectService>();

            RequestOptions = new ObservableCollection <ConnectRequestOptionModel>
            {
                new ConnectRequestOptionModel {
                    Name = "Professional date (Meet up for coffee, lunch or dinner)"
                },
                new ConnectRequestOptionModel {
                    Name = "Request assistance"
                },
                new ConnectRequestOptionModel {
                    Name = "Job advertisement"
                },
                new ConnectRequestOptionModel {
                    Name = "To ask you advice on:"
                }
            };
        }
Beispiel #7
0
        public void Open(IConnectKeys connectKeys)
        {
            if (_channelFactory != null)
            {
                if (_channelFactory.State == CommunicationState.Opened || _channelFactory.State == CommunicationState.Opening)
                {
                    return;
                }
            }

            var serviceAddress = new EndpointAddress(connectKeys.Url);

            _channelFactory = new ChannelFactory <IConnectService>(GetBinding(), serviceAddress);

            var credentials = new ConnectClientCredentials(connectKeys);

            credentials.ServiceCertificate.DefaultCertificate = GetCertificate();

            _channelFactory.Endpoint.Behaviors.Remove(typeof(ClientCredentials));
            _channelFactory.Endpoint.Behaviors.Add(credentials);

            Service = _channelFactory.CreateChannel();
        }
 public AuthorizationController(IConnectService connectService)
 {
     _connectService = connectService;
 }
 public HomeController(IConnectService connectService)
 {
     _connectService = connectService;
 }