Example #1
0
 public static TContract CreateProxy <TContract>(
     this ClientConfiguration clientConfiguration,
     IServerProvider serverProvider)
     where TContract : class
 {
     return(clientConfiguration.ProxyBuilder().Url(serverProvider).Build <TContract>());
 }
Example #2
0
 private void InitCredintails(int sendTimeOut, IServerProvider provider)
 {
     try
     {
         StaticServerProvider.Login(_userName, _password, _server, sendTimeOut, provider);
     }
     catch (FaultException <VersionFaultException> ex)
     {
         HasPassword   = false;
         _errorMessage = ex.Detail.ExMessage;
         return;
     }
     catch (MessageSecurityException)
     {
         HasPassword   = false;
         _errorMessage = "Неверное имя пользователя и/или пароль.";
         return;
     }
     catch (Exception ex)
     {
         HasPassword   = false;
         _errorMessage = ex.Message;
         return;
     }
     HasPassword = true;
 }
        public FrmMain(IServerProvider serverprovider)
        {
            this.serverprovider = serverprovider;
            query      = new ServerQuery();
            serverList = new List <ServerRow>();
            serverMap  = new Dictionary <ServerInfo, ServerRow>();
            icons      = new ImageList();
            icons.Images.Add("pw", Icons.lock_neutral);
            icons.Images.Add("pwTrue", Icons.lock_closed);
            icons.Images.Add("pwFalse", Icons.lock_open);
            blackpen = new Pen(new SolidBrush(Color.Black));
            InitializeComponent();

#if WITHLAUNCHER
            launcher     = new MLauncher();
            txtName.Text = launcher.GetName();
#endif
            lstServers.Columns[0].ImageKey = "pw";
            lstServers.Columns[5].Width    = SystemInformation.VirtualScreen.Width;
            lstServers.SmallImageList      = icons;
            loadServersThread = new Thread(LoadServers);
            loadServersThread.Start();

            tabPane.AddTab("Favorites");
            tabPane.AddTab("Internet");
            tabPane.AddTab("Hosted");
        }
 public ServerController(
     IHangfireManager hangfireManager,
     IServerProvider serverProvider)
 {
     _hangfireManager = hangfireManager;
     _serverProvider  = serverProvider;
 }
 public PickConnectionMiddleware(
     IServerProvider serverProvider,
     IEndpointProvider endpointProvider)
 {
     ServerProvider   = serverProvider ?? throw new ArgumentNullException(nameof(serverProvider));
     EndpointProvider = endpointProvider ?? throw new ArgumentNullException(nameof(endpointProvider));
 }
Example #6
0
 public AppealProvider(TestSessionStatistics statistics, int[] questIds, IServerProvider webServerProvider)
 {
     _webServerProvider = webServerProvider;
     _questIds.AddRange(questIds);
     _statistics = statistics;
     State       = ProviderState.Testing;
 }
Example #7
0
 public AutoConnectManager(BestVpnServerConnector connector, IVpnConnectionManager connectionManager, IServerProvider serverProvider, AppSettings appSettings, ILogger logger)
 {
     this._connector         = connector;
     this._connectionManager = connectionManager;
     this._serverProvider    = serverProvider;
     this._appSettings       = appSettings;
     this._logger            = logger;
 }
Example #8
0
        public static void Main()
        {
            serverProvider     = CreateServerProvider();
            tcpListenerWrapper = CreateTcpListenerWrapper();
            orionLogger        = CreateOrionLogger();

            serverProvider.RunServer();
        }
Example #9
0
        public override void Process(IList <SearchSource> item)
        {
            Recorder.Trace(4L, TraceType.InfoTrace, "ServerLookup.Process Item:", item);
            item.FirstOrDefault <SearchSource>();
            IList <SearchSource>        list = new List <SearchSource>();
            Func <SearchSource, string> func = delegate(SearchSource source)
            {
                if (source.MailboxInfo.IsRemoteMailbox)
                {
                    return(null);
                }
                if (source.MailboxInfo.IsArchive)
                {
                    return(source.MailboxInfo.ArchiveDatabase.ToString());
                }
                return(source.MailboxInfo.MdbGuid.ToString());
            };

            foreach (SearchSource searchSource in item)
            {
                string  text = func(searchSource);
                GroupId groupId;
                if (!string.IsNullOrEmpty(text) && this.TaskContext.LookupCache.TryGetValue(text, out groupId))
                {
                    Recorder.Trace(4L, TraceType.InfoTrace, "ServerLookup.Process Cache Hit GroupId:", groupId);
                    base.Executor.EnqueueNext(new FanoutParameters
                    {
                        GroupId = groupId,
                        Source  = searchSource
                    });
                }
                else
                {
                    list.Add(searchSource);
                }
            }
            if (list.Count > 0)
            {
                Recorder.Trace(4L, TraceType.InfoTrace, "ServerLookup.Process Cache Misses Count:", list.Count);
                IServerProvider serverProvider = SearchFactory.Current.GetServerProvider(base.Policy);
                foreach (FanoutParameters fanoutParameters in serverProvider.GetServer(base.Policy, list))
                {
                    if (fanoutParameters.GroupId != null && fanoutParameters.GroupId.Uri != null && fanoutParameters.GroupId.GroupType != GroupType.SkippedError)
                    {
                        string text2 = func(fanoutParameters.Source);
                        if (!string.IsNullOrEmpty(text2))
                        {
                            this.TaskContext.LookupCache.TryAdd(text2, fanoutParameters.GroupId);
                        }
                        base.Executor.EnqueueNext(fanoutParameters);
                    }
                    else
                    {
                        Recorder.Trace(4L, TraceType.InfoTrace, "ServerLookup.Process Ignoring an recipient group:", fanoutParameters.GroupId);
                    }
                }
            }
        }
        public PickConnectionMiddleware(IServerProvider serverProvider,
            IEndpointProvider endpointProvider)
        {
            if (serverProvider == null) throw new ArgumentNullException(nameof(serverProvider));
            if (endpointProvider == null) throw new ArgumentNullException(nameof(endpointProvider));

            ServerProvider = serverProvider;
            EndpointProvider = endpointProvider;
        }
Example #11
0
 public Server()
 {
     IPAddress        = IPAddress.Parse(ServerSettings.BoundIP);
     Port             = ServerSettings.BoundPort;
     ExternalHostname = ServerSettings.PublicHostname;
     ExternalPort     = ServerSettings.PublicPort;
     provider         = ProviderFactory.GetProvider(this.ExternalHostname, this.ExternalPort);
     provider.Init();
 }
 public SelectAutoConnectViewModel(IServerProvider serverProvider, AppSettings appSettings, UserPreferences userPreferences, ServerListFactory serverListFactory, IEventAggregator eventAggregator) : base(userPreferences)
 {
     this._serverListFactory = serverListFactory;
     serverProvider.add_ServersChanged(new EventHandler(this.OnServersChanged));
     this._appSettings                      = appSettings;
     this._eventAggregator                  = eventAggregator;
     this.< GoBack > k__BackingField        = new RelayCommand(new Action(this.GoBackCommand));
     this.< SelectServer > k__BackingField  = new RelayCommand <ServerItemViewModel>(new Action <ServerItemViewModel>(this.SelectServerCommand));
     this.< SelectCountry > k__BackingField = new RelayCommand <ServersByCountryViewModel>(new Action <ServersByCountryViewModel>(this.SelectCountryCommand));
 }
 public ServerStartupService(
     IApiMissionsClient apiMissionsClient,
     IModsetProvider modsetProvider,
     IServerProvider serverProvider,
     IModsUpdateService modsUpdateService)
 {
     _apiMissionsClient = apiMissionsClient;
     _modsetProvider    = modsetProvider;
     _serverProvider    = serverProvider;
     _modsUpdateService = modsUpdateService;
 }
Example #14
0
        public AddBookController(
            IBooksService booksService,
            IGenresService genresService,
            IUserProvider userProvider,
            IServerProvider serverProvider,
            ICacheProvider cacheProvider,
            IMapperAdapter mapper)
        {
            if (booksService == null)
            {
                throw new ArgumentNullException("booksService");
            }

            if (genresService == null)
            {
                throw new ArgumentNullException("genresService");
            }

            if (userProvider == null)
            {
                throw new ArgumentNullException("userProvider");
            }

            if (serverProvider == null)
            {
                throw new ArgumentNullException("serverProvider");
            }

            if (cacheProvider == null)
            {
                throw new ArgumentNullException("cacheProvider");
            }

            if (mapper == null)
            {
                throw new ArgumentNullException("mapper");
            }

            this.booksService   = booksService;
            this.genresService  = genresService;
            this.userProvider   = userProvider;
            this.serverProvider = serverProvider;
            this.cacheProvider  = cacheProvider;
            this.mapper         = mapper;
        }
Example #15
0
        public virtual ProxyBuilder Url(params Uri[] servers)
        {
            if (servers == null || !servers.Any())
            {
                throw new ArgumentNullException(nameof(servers));
            }

            if (servers.Length == 1)
            {
                _serverProvider = new SingleServerProvider(servers[0]);
            }
            else
            {
                _serverProvider = new MultipleServersProvider(servers);
            }

            return(this);
        }
Example #16
0
        public AddBarController(IMappingService mappingService,
                                IRegionsService regionsService,
                                IBarsService barsService,
                                ICacheProvider cacheProvider,
                                IServerProvider serverProvider,
                                IPathProvider pathProvider)
        {
            if (mappingService == null)
            {
                throw new ArgumentNullException("Mapping service cannot be null.");
            }

            if (regionsService == null)
            {
                throw new ArgumentNullException("Regions service cannot be null.");
            }

            if (barsService == null)
            {
                throw new ArgumentNullException("Bars service cannot be null.");
            }

            if (cacheProvider == null)
            {
                throw new ArgumentNullException("Cache provider cannot be null.");
            }

            if (serverProvider == null)
            {
                throw new ArgumentNullException("Server provider cannot be null.");
            }

            if (pathProvider == null)
            {
                throw new ArgumentNullException("Path provider cannot be null.");
            }

            this.mappingService = mappingService;
            this.regionsService = regionsService;
            this.barsService    = barsService;
            this.cacheProvider  = cacheProvider;
            this.serverProvider = serverProvider;
            this.pathProvider   = pathProvider;
        }
Example #17
0
 public RemoteTestingProvider(IServerProvider webServerProvider, TestorTreeItem selectedTest, TestorData testorData, StartTestParams startParams, bool useCompression)
 {
     _webServerProvider = webServerProvider;
     _selectedTest      = selectedTest;
     _testorData        = testorData;
     _coreTest          = CoreTestRowAdapter.GetAdapter(_testorData.CoreTests[0]);
     _useCompression    = useCompression;
     _startParams       = startParams;
     if (_startParams != null)
     {
         InitStartParams();
         _ansIds.AddRange(_startParams.AnsIds);
         _score = _startParams.CurrentScore;
     }
     else
     {
         State = ProviderState.PreTesting;
     }
 }
Example #18
0
 private static IDummyContract CreateProxy(ClientConfiguration configuration, IServerProvider serverProvider)
 {
     return(configuration.ProxyBuilder()
            .UseSession(true)
            .Recoverable(10, TimeSpan.FromSeconds(1))
            .Url(serverProvider).OnSending(
                async(next, context) =>
     {
         Console.WriteLine("Sending request to server: {0}:{1}", context.Request.RequestUri.Host, context.Request.RequestUri.Port);
         try
         {
             await next(context);
         }
         catch (Exception)
         {
             Console.WriteLine("Failed to send request to server: {0}:{1}", context.Request.RequestUri.Host, context.Request.RequestUri.Port);
             throw;
         }
     })
            .Build <IDummyContract>());
 }
Example #19
0
 public ServersController(IServerProvider server, IGatewayProvider gatewayProvider)
 {
     _server          = server;
     _gatewayProvider = gatewayProvider;
 }
Example #20
0
 public NetworkShare(IServerProvider serverProvider)
 {
     _serverProvider = serverProvider;
 }
Example #21
0
 public Avatar(IServerProvider serverProvider)
 {
     ServerProvider = serverProvider;
 }
Example #22
0
        // Copy constructor
        internal Options(Options o)
        {
            allowReconnect                   = o.allowReconnect;
            AsyncErrorEventHandler           = o.AsyncErrorEventHandler;
            HeartbeatAlarmEventHandler       = o.HeartbeatAlarmEventHandler;
            UnhandledStatusEventHandler      = o.UnhandledStatusEventHandler;
            FlowControlProcessedEventHandler = o.FlowControlProcessedEventHandler;
            ClosedEventHandler               = o.ClosedEventHandler;
            ServerDiscoveredEventHandler     = o.ServerDiscoveredEventHandler;
            DisconnectedEventHandler         = o.DisconnectedEventHandler;
            UserJWTEventHandler              = o.UserJWTEventHandler;
            UserSignatureEventHandler        = o.UserSignatureEventHandler;
            ReconnectDelayHandler            = o.ReconnectDelayHandler;
            LameDuckModeEventHandler         = o.LameDuckModeEventHandler;
            maxPingsOut                 = o.maxPingsOut;
            maxReconnect                = o.maxReconnect;
            name                        = o.name;
            noRandomize                 = o.noRandomize;
            noEcho                      = o.noEcho;
            ignoreDiscoveredServers     = o.ignoreDiscoveredServers;
            serverProvider              = o.serverProvider;
            pedantic                    = o.pedantic;
            reconnectBufSize            = o.reconnectBufSize;
            useOldRequestStyle          = o.useOldRequestStyle;
            pingInterval                = o.pingInterval;
            ReconnectedEventHandler     = o.ReconnectedEventHandler;
            reconnectJitter             = o.reconnectJitter;
            reconnectJitterTLS          = o.reconnectJitterTLS;
            reconnectWait               = o.reconnectWait;
            secure                      = o.secure;
            user                        = o.user;
            password                    = o.password;
            token                       = o.token;
            nkey                        = o.nkey;
            verbose                     = o.verbose;
            subscriberDeliveryTaskCount = o.subscriberDeliveryTaskCount;
            subscriptionBatchSize       = o.subscriptionBatchSize;
            customInboxPrefix           = o.customInboxPrefix;

            if (o.url != null)
            {
                processUrlString(o.url);
            }

            if (o.servers != null)
            {
                servers = new string[o.servers.Length];
                Array.Copy(o.servers, servers, o.servers.Length);
            }

            subChanLen = o.subChanLen;
            timeout    = o.timeout;
            TLSRemoteCertificationValidationCallback = o.TLSRemoteCertificationValidationCallback;

            if (o.certificates != null)
            {
                certificates = new X509Certificate2Collection(o.certificates);
            }

            CheckCertificateRevocation = o.CheckCertificateRevocation;
        }
Example #23
0
 public FavouriteServersUpdater(IServerProvider serverProvider, IUserStore userDataStore, IUserContext userContext)
 {
     this._serverProvider = serverProvider;
     this._userDataStore  = userDataStore;
     this._userContext    = userContext;
 }
Example #24
0
 public NntpProvider(INzbQueueProvider nzbQueue, IServerProvider server)
 {
     _nzbQueue = nzbQueue;
     _server = server;
     _connections = new List<ConnectionModel>();
 }
Example #25
0
 private LoginProvider(string userName, string password, string server, int sendTimeOut, IServerProvider provider)
 {
     _userName = userName;
     _password = password;
     _server   = server;
     InitCredintails(sendTimeOut, provider);
 }
Example #26
0
 public StartupService(IHangfireManager hangfireManager, IServerProvider serverProvider)
 {
     _hangfireManager = hangfireManager;
     _serverProvider  = serverProvider;
 }
 public ConsoleServerDisplayer(IServerProvider serverProvider)
 {
     m_serverProvider = serverProvider ?? throw new ArgumentNullException(nameof(serverProvider));
 }
Example #28
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            if (comboBoxUserName.Text.Trim() == String.Empty)
            {
                MessageBox.Show("Введите имя пользователя", "Ошибка",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                comboBoxUserName.Focus();
                return;
            }
            else if (comboBoxServer.Text.Trim() == String.Empty)
            {
                MessageBox.Show("Выберите сервер для подключения", "Ошибка",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                comboBoxUserName.Focus();
                return;
            }

            LoginForm.settingsUserName = comboBoxUserName.Text.Trim();
            LoginForm.settingsServer   = comboBoxServer.Text.Trim();

            UserName = settingsUserName;

            if (textBoxPassword.Text != "          ")
            {
                settingsPassword = textBoxPassword.Text.Trim();
            }
            if (!checkBoxSavePassword.Checked)
            {
                _autoComplete.WriteNewEntry(settingsUserName.Trim(), String.Empty, comboBoxServer.Text.Trim());
            }
            else
            {
                _autoComplete.WriteNewEntry(settingsUserName.Trim(), settingsPassword, comboBoxServer.Text.Trim());
            }
            buttonCancel.Enabled         = false;
            buttonOk.Enabled             = false;
            textBoxPassword.Enabled      = false;
            comboBoxUserName.Enabled     = false;
            checkBoxSavePassword.Enabled = false;
            comboBoxServer.Enabled       = false;
            linkLabelClearn.Enabled      = false;
            _isProcessing = true;
            IServerProvider wp = null;

            if (settingsServer.ToLower() == "sql")
            {
                try
                {
                    string connString = TestorSecurityProvider.ConnectionString;
                }
                catch (NullReferenceException)
                {
                    SystemMessage.ShowServerErrorMessage("Строка подключения к базе данных не задана");
                    _isProcessing = false;
                    InitForm();
                    return;
                }
                wp = new WebServerProvider(settingsUserName);
            }
            LoginProvider provider = LoginProvider.Login(settingsUserName, settingsPassword, settingsServer, SEND_TIMEOUT, wp,
                                                         new LoginProvider.LoginResultDelegate((hasPassword, errorMessage) =>
            {
                this.Invoke((Action)(() =>
                {
                    _isProcessing = false;
                    if (!hasPassword)
                    {
                        SystemMessage.ShowErrorMessage(errorMessage);
                        InitForm();
                    }
                    else
                    {
                        this.DialogResult = DialogResult.OK;
                    }
                }));
            }));
        }
Example #29
0
 public static LoginProvider Login(string userName, string password, string server, int sendTimeOut, IServerProvider provider, LoginResultDelegate callback)
 {
     return(new LoginProvider(userName, password, server, callback, sendTimeOut, provider));
 }
Example #30
0
 public static LoginProvider LoginSync(string userName, string password, string server, int sendTimeOut, IServerProvider provider)
 {
     return(new LoginProvider(userName, password, server, sendTimeOut, provider));
 }
 public AutoConnector(BestVpnServerConnector connector, IServerProvider serverProvider)
 {
     this._connector      = connector;
     this._serverProvider = serverProvider;
 }
Example #32
0
 public ServerController(IServerProvider serverProvider)
 {
     _serverProvider = serverProvider;
 }
 public ServersSearchFacade(IServerProvider serverProvider, ServersSearcher serversSearcher, CountriesSearcher countriesSearcher)
 {
     this._serverProvider    = serverProvider;
     this._serversSearcher   = serversSearcher;
     this._countriesSearcher = countriesSearcher;
 }
Example #34
0
        private LoginProvider(string userName, string password, string server, LoginResultDelegate callback, int sendTimeOut, IServerProvider provider)
        {
            _callback = callback;
            _userName = userName;
            _password = password;
            _server   = server;
            TestorLoginDelegate icd = new TestorLoginDelegate(InitCredintails);

            icd.BeginInvoke(sendTimeOut, provider, new AsyncCallback((o) =>
            {
                _callback.Invoke(HasPassword, _errorMessage);
            }), null);
        }