• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ClientConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ClientConfiguration的典型用法代码示例。如果您正苦于以下问题:C# ClientConfiguration类的具体用法?C# ClientConfiguration怎么用?C# ClientConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ClientConfiguration类属于命名空间,在下文中一共展示了ClientConfiguration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ShouldBeInvalidIfUserNameIsNull

 public void ShouldBeInvalidIfUserNameIsNull()
 {
     ClientConfiguration configuration = new ClientConfiguration() { Password = "password", Host = "smtp.google.com", Port = 445, Ssl = true };
     ErrorList errors = configuration.Validate();
     Assert.AreEqual(1, errors.Count);
     Assert.AreEqual("UserName can't be blank", errors[0].ToString());
 }
开发者ID:jskswamy,项目名称:ConsoleMailer,代码行数:7,代码来源:ClientConfigurationTest.cs


示例2: ShouldBeInvalidIfHostIsNull

 public void ShouldBeInvalidIfHostIsNull()
 {
     ClientConfiguration configuration = new ClientConfiguration() { UserName = "user", Password = "password", Port = 445, Ssl = true };
     ErrorList errors = configuration.Validate();
     Assert.AreEqual(1, errors.Count);
     Assert.AreEqual("Host can't be blank", errors[0].ToString());
 }
开发者ID:jskswamy,项目名称:ConsoleMailer,代码行数:7,代码来源:ClientConfigurationTest.cs


示例3: Main

        static void Main(string[] args)
        {
            Console.WriteLine("Start");

            var config = new ClientConfiguration()
                .LoadFromEmbeddedResource(typeof(Program), "Client.xml");

            var system = ActorSystem.Configure()
                .Client()
                .From(config)
                .Register(typeof(ActorWithReminder).Assembly)
                .Done();


            Console.WriteLine("Started");

            while (true)
            {
                Console.WriteLine("Press c key to check reminder or r to register");
                var k = Console.ReadKey();
                if (k.KeyChar == 'c')
                {
                    system.ActorOf<ActorWithReminder>("Any").Ask<bool>(new CheckReminder())
                          .ContinueWith(p => Console.WriteLine("Reminder check result: {0}", p.Result));
                }

                if (k.KeyChar == 'r')
                {
                    system.ActorOf<ActorWithReminder>("Any").Tell(new InitReminder())
                         .ContinueWith(p => Console.WriteLine("Reminder init result: {0}", p.Status));
                }

            }
        }
开发者ID:zloom,项目名称:Orleankka,代码行数:34,代码来源:Program.cs


示例4: SetRootDomains

        public static void SetRootDomains()
        {
            const string accessId = "<your access id>";
            const string accessKey = "<your access key>";
            const string endpoint = "<valid host name>";

            try
            {
                var conf = new ClientConfiguration();
                var domainList = conf.RootDomainList;
                foreach (var domain in domainList)
                {
                    Console.WriteLine(domain);
                }

                Console.WriteLine("\nafter modifed: ");
                var domains = new List<string> {".alibaba-inc.com", ".aliyuncs.gd"};
                conf.RootDomainList = domains;
                foreach (string domain in conf.RootDomainList)
                {
                    Console.WriteLine(domain);
                }

                var client = new OssClient(new Uri(endpoint), accessId, accessKey, conf);
            }
            catch (OssException ex)
            {
                Console.WriteLine("Failed with error code: {0}; Error info: {1}. \nRequestID:{2}\tHostID:{3}",
                    ex.ErrorCode, ex.Message, ex.RequestId, ex.HostId);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Failed with error info: {0}", ex.Message);
            }
        }
开发者ID:bys-james-shi,项目名称:OpenSource,代码行数:35,代码来源:CNameSample.cs


示例5: CreateGatewayListProvider

        internal static async Task<IGatewayListProvider> CreateGatewayListProvider(ClientConfiguration cfg)
        {
            IGatewayListProvider listProvider = null;
            ClientConfiguration.GatewayProviderType gatewayProviderToUse = cfg.GatewayProviderToUse;

            switch (gatewayProviderToUse)
            {
                case ClientConfiguration.GatewayProviderType.AzureTable:
                    listProvider = AssemblyLoader.LoadAndCreateInstance<IGatewayListProvider>(Constants.ORLEANS_AZURE_UTILS_DLL, logger);
                    break;

                case ClientConfiguration.GatewayProviderType.SqlServer:
                    listProvider = AssemblyLoader.LoadAndCreateInstance<IGatewayListProvider>(Constants.ORLEANS_SQL_UTILS_DLL, logger);
                    break;

                case ClientConfiguration.GatewayProviderType.Custom:
                    listProvider = AssemblyLoader.LoadAndCreateInstance<IGatewayListProvider>(cfg.CustomGatewayProviderAssemblyName, logger);
                    break;

                case ClientConfiguration.GatewayProviderType.ZooKeeper:
                    listProvider = AssemblyLoader.LoadAndCreateInstance<IGatewayListProvider>(Constants.ORLEANS_ZOOKEEPER_UTILS_DLL, logger);
                    break;

                case ClientConfiguration.GatewayProviderType.Config:
                    listProvider = new StaticGatewayListProvider();
                    break;

                default:
                    throw new NotImplementedException(gatewayProviderToUse.ToString());
            }

            await listProvider.InitializeGatewayListProvider(cfg, LogManager.GetLogger(listProvider.GetType().Name));
            return listProvider;
        }
开发者ID:Rejendo,项目名称:orleans,代码行数:34,代码来源:GatewayProviderFactory.cs


示例6: ShouldBeAbleToSaveTheConfigurationToFile

 public void ShouldBeAbleToSaveTheConfigurationToFile()
 {
     ClientConfiguration configuration = new ClientConfiguration();
     configuration.Save(configurationFileName);
     Assert.IsTrue(File.Exists(configurationFileName));
     File.Delete(configurationFileName);
 }
开发者ID:jskswamy,项目名称:ConsoleMailer,代码行数:7,代码来源:ClientConfigurationTest.cs


示例7: AzureQueueDataManagerTests

 public AzureQueueDataManagerTests()
 {
     ClientConfiguration config = new ClientConfiguration();
     config.TraceFilePattern = null;
     TraceLogger.Initialize(config);
     logger = TraceLogger.GetLogger("AzureQueueDataManagerTests", TraceLogger.LoggerType.Application);
 }
开发者ID:stanroze,项目名称:orleans,代码行数:7,代码来源:AzureQueueDataManagerTests.cs


示例8: InitializeGatewayListProvider

 public Task InitializeGatewayListProvider(ClientConfiguration config, TraceLogger traceLogger)
 {
     deploymentId = config.DeploymentId;
     connectionString = config.DataConnectionString;
     maxStaleness = config.GatewayListRefreshPeriod;
     return TaskDone.Done;
 }
开发者ID:stanroze,项目名称:orleans,代码行数:7,代码来源:SqlMembershipTable.cs


示例9: GatewaySelection_ClientInit_EmptyList

        public void GatewaySelection_ClientInit_EmptyList()
        {
            var cfg = new ClientConfiguration();
            cfg.Gateways = null;
            bool failed = false;
            try
            {
                GrainClient.Initialize(cfg);
            }
            catch (Exception exc)
            {
                output.WriteLine(exc.ToString());
                failed = true;
            }
            Assert.IsTrue(failed, "GatewaySelection_EmptyList failed as GatewayManager did not throw on empty Gateway list.");

            // Note: This part of the test case requires a silo local to be running in order to work successfully.

            //var listProvider = new TestListProvider(gatewayAddressUris);
            //cfg.Gateways = listProvider.GetGateways().Select(uri =>
            //{
            //    return new IPEndPoint(IPAddress.Parse(uri.Host), uri.Port);
            //}).ToList();
            //Client.Initialize(cfg);
        }
开发者ID:caomw,项目名称:orleans,代码行数:25,代码来源:GatewaySelectionTest.cs


示例10: GetClientEndpoint

 private void GetClientEndpoint()
 {
     var clientFactory = new ClientFactory();
     var clientConfig = new ClientConfiguration();
     clientConfig.MaxSessions = 10;
     client = clientFactory.MakeNew(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 3000), clientConfig);
 }
开发者ID:Zyruis11,项目名称:netSharp,代码行数:7,代码来源:Program.cs


示例11: ProxiedMessageCenter

 public ProxiedMessageCenter(ClientConfiguration config, IPAddress localAddress, int gen, GrainId clientId, IGatewayListProvider gatewayListProvider)
 {
     lockable = new object();
     MyAddress = SiloAddress.New(new IPEndPoint(localAddress, 0), gen);
     ClientId = clientId;
     Running = false;
     MessagingConfiguration = config;
     GatewayManager = new GatewayManager(config, gatewayListProvider);
     PendingInboundMessages = new RuntimeQueue<Message>();
     gatewayConnections = new Dictionary<Uri, GatewayConnection>();
     numMessages = 0;
     grainBuckets = new WeakReference[config.ClientSenderBuckets];
     logger = TraceLogger.GetLogger("Messaging.ProxiedMessageCenter", TraceLogger.LoggerType.Runtime);
     if (logger.IsVerbose) logger.Verbose("Proxy grain client constructed");
     IntValueStatistic.FindOrCreate(StatisticNames.CLIENT_CONNECTED_GATEWAY_COUNT, () =>
         {
             lock (gatewayConnections)
             {
                 return gatewayConnections.Values.Count(conn => conn.IsLive);
             }
         });
     if (StatisticsCollector.CollectQueueStats)
     {
         queueTracking = new QueueTrackingStatistic("ClientReceiver");
     }
 }
开发者ID:NingnaD,项目名称:orleans,代码行数:26,代码来源:ProxiedMessageCenter.cs


示例12: OAuth2Client

        /// <summary>
        /// Initializes a new instance of <c>OAuth2Client</c>.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <exception cref="ArgumentNullException"><paramref name="configuration"/> was <see langword="null"/>.</exception>
        public OAuth2Client(ClientConfiguration configuration)
        {
            if (null == configuration)
                throw new ArgumentNullException("configuration");

            this.Configuration = configuration;
        }
开发者ID:nodoubt223rd,项目名称:simpleoauth.net,代码行数:12,代码来源:client.cs


示例13: Connect

        public async Task<bool> Connect()
        {

            SpiderLogger.Info("------------------启动 Orleans Client.------------------");
            try
            {
                if (!Orleans.GrainClient.IsInitialized)
                {
                    ClientConfiguration config = new ClientConfiguration();
                    config.GatewayProvider = ClientConfiguration.GatewayProviderType.Config;
                    IPEndPoint ip=new IPEndPoint(IPAddress.Parse("127.0.0.1"),30000);
                    config.Gateways.Add(ip);
                    config.StatisticsMetricsTableWriteInterval = TimeSpan.FromSeconds(30);
                    config.StatisticsLogWriteInterval = TimeSpan.FromSeconds(300);
                    config.StatisticsWriteLogStatisticsToTable = false;
                    config.StatisticsPerfCountersWriteInterval = TimeSpan.FromSeconds(30);
                    Orleans.GrainClient.Initialize(config);
                }
                IServices server = GrainClient.GrainFactory.GetGrain<IServices>(Guid.NewGuid());
                return await server.ConnectToServer(Dns.GetHostName());
                
            }
            catch (Exception ex)
            {
                SpiderLogger.Error("启动 Orleans Client 失败." + ex.Message+"\r\n");
                SpiderLogger.Error(ex.StackTrace);
                return false;

            }           
        }
开发者ID:svenliao,项目名称:scrapy.sscq,代码行数:30,代码来源:OrleansClient.cs


示例14: InitializeAgatha

 private static void InitializeAgatha()
 {
     var config = new ClientConfiguration(typeof(HelloWorldRequest).Assembly, typeof(Ninject.Container))
                      {
                          CacheManagerImplementation = typeof(InvalidatingCacheManager)
                      };
     config.Initialize();
 }
开发者ID:joakes,项目名称:Hello-Agatha,代码行数:8,代码来源:Program.cs


示例15: ClientConfiguration

 public ClientConfiguration(ClientConfiguration existing)
     : this(apiKey: existing?.ApiKey,
           cacheManager: existing?.CacheManager,
           baseUrl: existing?.BaseUrl,
           connectionTimeout: existing?.ConnectionTimeout,
           authenticationScheme: existing?.AuthenticationScheme,
           proxy: existing?.Proxy)
 {
 }
开发者ID:stormpath,项目名称:stormpath-dotnet-config,代码行数:9,代码来源:ClientConfiguration.cs


示例16: StormpathConfiguration

 public StormpathConfiguration(
     ClientConfiguration client = null,
     ApplicationConfiguration application = null,
     WebConfiguration web = null)
 {
     this.Client = new ClientConfiguration(client ?? Default.Configuration.Client);
     this.Application = new ApplicationConfiguration(application ?? Default.Configuration.Application);
     this.Web = new WebConfiguration(web ?? Default.Configuration.Web);
 }
开发者ID:stormpath,项目名称:stormpath-dotnet-config,代码行数:9,代码来源:StormpathConfiguration.cs


示例17: InitializeGatewayListProvider

        public async Task InitializeGatewayListProvider(ClientConfiguration config, TraceLogger traceLogger)
        {
            logger = traceLogger;
            if (logger.IsVerbose3) logger.Verbose3("SqlMembershipTable.InitializeGatewayListProvider called.");

            deploymentId = config.DeploymentId;            
            maxStaleness = config.GatewayListRefreshPeriod;
            orleansQueries = await RelationalOrleansQueries.CreateInstance(config.AdoInvariant, config.DataConnectionString);
        }
开发者ID:sbambach,项目名称:orleans,代码行数:9,代码来源:SqlMembershipTable.cs


示例18: Initialize

 public static void Initialize(IKernel kernel)
 {
     var container = new Ninject.Container(kernel);
     var config = new ClientConfiguration(typeof(HelloWorldRequest).Assembly, container)
     {
         CacheManagerImplementation = typeof(InvalidatingCacheManager)
     };
     config.Initialize();
 }
开发者ID:joakes,项目名称:Hello-Agatha,代码行数:9,代码来源:ServiceConfig.cs


示例19: Client

        public Client(SessionManager _sessionManager, IPEndPoint _ipEndpoint,
            ClientConfiguration _clientConfiguration = null)
        {
            sessionManager = _sessionManager;
            ipEndPoint = _ipEndpoint;

            ApplyClientConfiguration(_clientConfiguration ?? new ClientConfiguration());

            Guid = ShortGuid.New();
        }
开发者ID:Zyruis11,项目名称:netSharp,代码行数:10,代码来源:Client.cs


示例20: Initialize

        public static void Initialize(ClientConfiguration configuration)
        {
            // TODO: make this configurable from outside

            configuration.DeploymentId = RoleEnvironment.DeploymentId;
            configuration.DataConnectionString = RoleEnvironment.GetConfigurationSettingValue("DataConnectionString");
            configuration.GatewayProvider = ClientConfiguration.GatewayProviderType.AzureTable;

            AzureClient.Initialize(configuration);
        }
开发者ID:supwar,项目名称:Orleankka,代码行数:10,代码来源:AzureClientActorSystem.cs



注:本文中的ClientConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ClientContext类代码示例发布时间:2022-05-24
下一篇:
C# ClientConfig类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap