/// <summary>
        /// Регистрация WCF сервисов
        /// </summary>
        private static void RegisterServices(IUnityContainer unityContainer)
        {
            var clientEndpoints = new ClientEndpoints();

            string fileConvertingEndpoint = clientEndpoints.GetEndpointByInterfaceFullPath(typeof(IFileConvertingClientService));

            unityContainer.RegisterFactory <IServiceConsumer <IFileConvertingClientService> >(unity =>
                                                                                              ServiceConsumerFactory.Create <IFileConvertingClientService>(fileConvertingEndpoint));

            string signatureEndpoint = clientEndpoints.GetEndpointByInterfaceFullPath(typeof(ISignatureClientService));

            unityContainer.RegisterFactory <IServiceConsumer <ISignatureClientService> >(unity =>
                                                                                         ServiceConsumerFactory.Create <ISignatureClientService>(signatureEndpoint));

            string serverStateEndpoint = clientEndpoints.GetEndpointByInterfaceFullPath(typeof(IServerStateClientService));

            unityContainer.RegisterFactory <IServiceConsumer <IServerStateClientService> >(unity =>
                                                                                           ServiceConsumerFactory.Create <IServerStateClientService>(serverStateEndpoint));

            string historyEndpoint = clientEndpoints.GetEndpointByInterfaceFullPath(typeof(IHistoryClientService));

            unityContainer.RegisterFactory <IServiceConsumer <IHistoryClientService> >(unity =>
                                                                                       ServiceConsumerFactory.Create <IHistoryClientService>(historyEndpoint));

            string likeEndpoint = clientEndpoints.GetEndpointByInterfaceFullPath(typeof(ILikeClientService));

            unityContainer.RegisterFactory <IServiceConsumer <ILikeClientService> >(unity =>
                                                                                    ServiceConsumerFactory.Create <ILikeClientService>(likeEndpoint));

            unityContainer.RegisterFactory <IWcfClientServicesFactory>(unity =>
                                                                       new WcfClientServicesFactory(() => unity.Resolve <IServiceConsumer <IFileConvertingClientService> >(),
                                                                                                    () => unity.Resolve <IServiceConsumer <ISignatureClientService> >(),
                                                                                                    () => unity.Resolve <IServiceConsumer <IServerStateClientService> >(),
                                                                                                    () => unity.Resolve <IServiceConsumer <IHistoryClientService> >()));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Регистрация WCF сервисов
        /// </summary>
        public static void RegisterServices(IUnityContainer container)
        {
            var    clientEndpoints        = new ClientEndpoints();
            string fileConvertingEndpoint = clientEndpoints.GetEndpointByInterfaceFullPath(typeof(IFileConvertingServerService));

            container.RegisterFactory <IAccessService>(unity => new AccessService(TIME_OUT_MINUTES_OPERATION));

            container.RegisterFactory <IServiceConsumer <IFileConvertingServerService> >(unity =>
                                                                                         ServiceConsumerFactory.Create <IFileConvertingServerService>(fileConvertingEndpoint));

            string signatureEndpoint = clientEndpoints.GetEndpointByInterfaceFullPath(typeof(ISignatureServerService));

            container.RegisterFactory <IServiceConsumer <ISignatureServerService> >(unity =>
                                                                                    ServiceConsumerFactory.Create <ISignatureServerService>(signatureEndpoint));

            container.RegisterFactory <IWcfServerServicesFactory>(unity =>
                                                                  new WcfServerServicesFactory(() => unity.Resolve <IServiceConsumer <IFileConvertingServerService> >(),
                                                                                               () => unity.Resolve <IServiceConsumer <ISignatureServerService> >()),
                                                                  new SingletonLifetimeManager());
        }
Ejemplo n.º 3
0
 public ClientsApi(Endpoints endPoints, IApiClient apiClient, IJsonSerializer serializer, Credentials credentials)
     : base(apiClient, serializer, credentials, endPoints.LoggedIn)
 {
     this.endPoints = endPoints.Clients;
 }