当前位置: 首页>>代码示例>>C#>>正文


C# AppHost类代码示例

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


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

示例1: MeropsRegistry

        public MeropsRegistry(AppHost appHost, RpcConfig config)
            : base(config)
        {
            Config = config;
            _appHost = appHost;

            _registryClient = new Lazy<IRegistryService>(() =>
            {
                var address = Config?.Registry?.Address;

                if (string.IsNullOrWhiteSpace(address))
                {
                    LogHelper.Error("Registry Client Config Error: not exist or path is empty");
                    return null;
                }

                var client = _appHost == null
                    ? ClientFactory.GetInstance<IRegistryService>(address)
                    : _appHost.ClientFactory.GetInstance<IRegistryService>(address);
                return client;
            });

            InitilizeAddresses();
            // ReSharper disable once VirtualMemberCallInConstructor
            StartUpdateRegistry();
        }
开发者ID:chrishaly,项目名称:RpcLite,代码行数:26,代码来源:MeropsRegistry.cs

示例2: Main

        public static void Main(string[] args)
        {
            Console.WriteLine ("Starting monotest service");

            // configure JSON serializer
            JsConfig.EmitCamelCaseNames = true;

            var exit = false;
            var signals = new[] {
                new UnixSignal(Signum.SIGINT),
                new UnixSignal(Signum.SIGTERM)
            };

            var host = new AppHost();

            host.Init();
            host.Start("http://+:8080/");

            // wait for termination
            while (!exit)
            {
                var id = UnixSignal.WaitAny(signals);

                if (id >= 0 && id < signals.Length)
                {
                    if (signals[id].IsSet)
                        exit = true;
                }
            }

            Console.WriteLine("Terminating monotest service");
        }
开发者ID:kongo2002,项目名称:docker-centos-servicestack,代码行数:32,代码来源:Program.cs

示例3: JournalServiceTests

 public JournalServiceTests()
 {
     stopWatch = Stopwatch.StartNew();
     appHost = new AppHost();
     appHost.Init();
     appHost.Start("http://*:8888/");
 }
开发者ID:KyleGobel,项目名称:Systematize,代码行数:7,代码来源:JournalServiceTests.cs

示例4: TestFixtureSetUp

 public void TestFixtureSetUp()
 {
     LogManager.LogFactory = new ConsoleLogFactory();
     appHost = new AppHost();
     appHost.Init();
     appHost.Start("http://*:1337/");
 }
开发者ID:ServiceStack,项目名称:ServiceStack,代码行数:7,代码来源:Benchmarks.cs

示例5: TestFixtureSetUp

	    public void TestFixtureSetUp()
	    {
            startedAt = Stopwatch.StartNew();
            appHost = new AppHost();
	        appHost.Init();
            appHost.Start("http://*:1337/");
	    }
开发者ID:BilliamBrown,项目名称:ServiceStack,代码行数:7,代码来源:RazorRockstars_EmbeddedFilesTests.cs

示例6: Application_Start

        protected void Application_Start(object sender, EventArgs e)
        {
            Licensing.RegisterLicenseFromFileIfExists(@"~/appsettings.license.txt".MapHostAbsolutePath());

            var appHost = new AppHost();
            appHost.Init();
        }
开发者ID:zhyhunan,项目名称:RedisAdminUI,代码行数:7,代码来源:Global.asax.cs

示例7: Init

        public void Init()
        {
            var configure = Configure.With()
            .DefaultBuilder()
                .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.EndsWith("Commands"))
                .DefiningEventsAs(t => t.Namespace != null && t.Namespace.EndsWith("Events"))
            .RunTimeoutManager()
            .Log4Net()
            .XmlSerializer()
            .MsmqTransport()
                .IsTransactional(true)
                .PurgeOnStartup(false)
            .RavenPersistence()
            .Sagas()
                .RavenSagaPersister()
            .UnicastBus()
                .ImpersonateSender(false)
                .LoadMessageHandlers();

            const string listeningOn = "http://*:8888/";
            var appHost = new AppHost();
            appHost.Init();
            appHost.Start(listeningOn);

            Configure.Instance.Configurer.ConfigureComponent<RavenDocStore>(DependencyLifecycle.SingleInstance);
            Configure.Instance.Configurer.ConfigureComponent<TimeoutCalculator>(DependencyLifecycle.InstancePerUnitOfWork);
            Configure.Instance.Configurer.ConfigureComponent<SmsService>(DependencyLifecycle.InstancePerUnitOfWork);
            Configure.Instance.Configurer.ConfigureComponent<SmsTechWrapper>(DependencyLifecycle.InstancePerUnitOfWork);

            var bus = configure.CreateBus().Start();            //.Start(() => Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install());

            appHost.Container.Register(bus);
            appHost.Container.RegisterAutoWiredAs<RavenDocStore, IRavenDocStore>();//.RegisterAs<IRavenDocStore>(new RavenDocStore());
        }
开发者ID:Compassion,项目名称:SmsScheduler,代码行数:34,代码来源:EndpointConfig.cs

示例8: Run

        public override int Run(string[] remainingArguments)
        {
            var packageRepositories = new List<IPackageRepository>();

            if (!string.IsNullOrEmpty(Json))
                packageRepositories.Add(new JsonFilePackageRepository(Json));

            if (!string.IsNullOrEmpty(Xml))
                packageRepositories.Add(new XmlFilePackageRepository(Xml));

            if (!string.IsNullOrEmpty(StashBaseUri) && !string.IsNullOrEmpty(StashProjectKey))
                packageRepositories.Add(new StashPackageRepository(StashBaseUri, StashProjectKey, StashUsername, StashPassword, StashSshInsteadOfHttp));

            if (packageRepositories.Count == 0)
                packageRepositories.Add(new InMemoryPackageRepository());

            var listener = string.Format("http://*:{0}/", Port);

            var appHost = new AppHost();
            appHost.Init();
            appHost.Container.Register<IPackageRepository>(_ => new AggregatePackageRepository(packageRepositories));

            System.Console.WriteLine("Listening on {0}", listener);
            appHost.Start(listener);

            Thread.Sleep(Timeout.Infinite);

            return 0;
        }
开发者ID:rolandzwaga,项目名称:Bower-Registry,代码行数:29,代码来源:ServerCommand.cs

示例9: MeropsMonitor

		public MeropsMonitor(AppHost appHost, RpcConfig config)
		{
			//var factory = new RpcClientFactory(null, null);
			_client = appHost.ClientFactory.GetInstance<IMonitorService>(config?.Monitor.Address);
			// ReSharper disable once UnusedVariable
			var writeTask = WriteLogsAsync();
		}
开发者ID:chrishaly,项目名称:RpcLite,代码行数:7,代码来源:MeropsMonitor.cs

示例10: Application_Start

		protected void Application_Start(Object sender, EventArgs e)
		{
			// Make package reposiroties.
			var packageRepositories = new List<IPackageRepository>();

			// Get bowerRegistryConfigurationSection
			var bowerRegistryConfigurationSection = ConfigurationManager.GetSection(BowerRegistryConfigurationSection.SectionName) as BowerRegistryConfigurationSection;
			if (bowerRegistryConfigurationSection != null)
			{
				// Get custom repositories.
				foreach (var packageRepository in bowerRegistryConfigurationSection.Repositories)
				{
					if (packageRepository.GetType() == typeof(InMemory))
						packageRepositories.Add(new InMemoryPackageRepository());

					if (packageRepository.GetType() == typeof(XmlFile))
						packageRepositories.Add(new XmlFilePackageRepository(((XmlFile)packageRepository).FilePath));

					if (packageRepository.GetType() == typeof(JsonFile))
						packageRepositories.Add(new JsonFilePackageRepository(((JsonFile)packageRepository).FilePath));

					if(packageRepository.GetType() == typeof(Stash))
					{
						var stash = packageRepository as Stash; 
						packageRepositories.Add(new StashPackageRepository(stash.BaseUri, stash.ProjectKey, stash.Username, stash.Password, stash.UseSSH));
					}
				}
			}

			// Start app.
			var appHost = new AppHost();
			appHost.Init();
			appHost.Container.Register<IPackageRepository>(_ => new AggregatePackageRepository(packageRepositories));
		}
开发者ID:rolandzwaga,项目名称:Bower-Registry,代码行数:34,代码来源:Global.asax.cs

示例11: Main

        static void Main (string[] args)
        {
            App = new AppHost("http://localhost:1337/")
                .Start();

            NSApplication.Init ();
            NSApplication.Main (args);
        }
开发者ID:KevinHoward,项目名称:ServiceStack.Gap,代码行数:8,代码来源:Main.cs

示例12: Application_Start

        protected void Application_Start(object sender, EventArgs e)
        {
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            var host = new AppHost();
            host.Init();
        }
开发者ID:BartAdv,项目名称:IssueTracker,代码行数:8,代码来源:Global.asax.cs

示例13: Main

 public static void Main()
 {
     // Very simple console host
     var appHost = new AppHost(500);
     appHost.Init();
     appHost.Start("http://*:9000/");
     Console.ReadKey();
 }
开发者ID:scottmcarthur,项目名称:ServiceStackAdvancedPermissions,代码行数:8,代码来源:Program.cs

示例14: AppHost

 public static void Запустить()
 {
     const string listeningOn = "https://*:1337/";
     var appHost = new AppHost();
     appHost.Init();
     appHost.Start(listeningOn);
     Console.WriteLine("AppHost Created at {0}, listening on {1}", DateTime.Now, listeningOn);
 }
开发者ID:Rugut,项目名称:UPP,代码行数:8,代码来源:WebHost.cs

示例15: Main

        static void Main(string[] args)
        {
            var appHost = new AppHost();
            appHost.Init();
            appHost.Start("http://localhost:2211/");

            Console.Read();
        }
开发者ID:gregsochanik,项目名称:basic-servicestack-catalogue,代码行数:8,代码来源:Program.cs


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