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


C# IApplicationHost类代码示例

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


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

示例1: CreateContainer

        private void CreateContainer(HttpConfiguration configuration,IApplicationHost applicationHost,IConfigurationProvider configurationProvider)
        {
            var assemblies          = applicationHost.Assemblies.ToArray();
            var containerBuilder    = new ContainerBuilder();

            containerBuilder.RegisterModelBinderProvider();
            //containerBuilder.RegisterFilterProvider(); TODO: Seems to be an autofac MVC4 integration issue
            containerBuilder.RegisterModelBinders(assemblies);
            containerBuilder.RegisterApiControllers(assemblies);
            containerBuilder.RegisterControllers(assemblies);
            containerBuilder.RegisterWebApiFilterProvider(configuration);
            containerBuilder.RegisterWebApiModelBinders(assemblies);
            containerBuilder.RegisterModule(new AutofacWebTypesModule());

            containerBuilder.RegisterAssemblyModules(assemblies);
            containerBuilder.RegisterAssemblyTypes(assemblies).Where(t => t.IsAssignableTo<IRouteProvider>()).As<IRouteProvider>();
            containerBuilder.RegisterAssemblyTypes(assemblies).Where(t => t.IsAssignableTo<IBootTask>()).As<IBootTask>();
            containerBuilder.RegisterAssemblyTypes(assemblies).Where(t => t.IsAssignableTo<AreaRegistration>()).As<AreaRegistration>();

            containerBuilder.RegisterInstance(applicationHost).As<IApplicationHost>();
            containerBuilder.RegisterInstance(configurationProvider).As<IConfigurationProvider>();

            var container = containerBuilder.Build();

            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
            configuration.DependencyResolver = new AutofacWebApiDependencyResolver(container);
            SignalR.GlobalHost.DependencyResolver = new AutofacSignalRDependencyResolver(container);
        }
开发者ID:BernhardGlueck,项目名称:Wmc,代码行数:28,代码来源:Global.asax.cs

示例2: UsageReporter

 public UsageReporter(IApplicationHost applicationHost, IHttpClient httpClient, IUserManager userManager, ILogger logger)
 {
     _applicationHost = applicationHost;
     _httpClient = httpClient;
     _userManager = userManager;
     _logger = logger;
 }
开发者ID:t-andre,项目名称:Emby,代码行数:7,代码来源:UsageReporter.cs

示例3: ChannelImageProvider

 public ChannelImageProvider(ILiveTvManager liveTvManager, IHttpClient httpClient, ILogger logger, IApplicationHost appHost)
 {
     _liveTvManager = liveTvManager;
     _httpClient = httpClient;
     _logger = logger;
     _appHost = appHost;
 }
开发者ID:softworkz,项目名称:Emby,代码行数:7,代码来源:ChannelImageProvider.cs

示例4:

 bool IServerConfig.GetUncUser(IApplicationHost appHost, VirtualPath path, out string username, out string password)
 {
     bool flag = false;
     username = null;
     password = null;
     IntPtr zero = IntPtr.Zero;
     int cchUserName = 0;
     IntPtr bstrPassword = IntPtr.Zero;
     int cchPassword = 0;
     try
     {
         if (UnsafeIISMethods.MgdGetVrPathCreds(IntPtr.Zero, appHost.GetSiteName(), path.VirtualPathString, out zero, out cchUserName, out bstrPassword, out cchPassword) == 0)
         {
             username = (cchUserName > 0) ? StringUtil.StringFromWCharPtr(zero, cchUserName) : null;
             password = (cchPassword > 0) ? StringUtil.StringFromWCharPtr(bstrPassword, cchPassword) : null;
             flag = !string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password);
         }
     }
     finally
     {
         if (zero != IntPtr.Zero)
         {
             Marshal.FreeBSTR(zero);
         }
         if (bstrPassword != IntPtr.Zero)
         {
             Marshal.FreeBSTR(bstrPassword);
         }
     }
     return flag;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:31,代码来源:ProcessHostServerConfig.cs

示例5: SchedulesDirect

 public SchedulesDirect(ILogger logger, IJsonSerializer jsonSerializer, IHttpClient httpClient, IApplicationHost appHost)
 {
     _logger = logger;
     _jsonSerializer = jsonSerializer;
     _httpClient = httpClient;
     _appHost = appHost;
 }
开发者ID:softworkz,项目名称:Emby,代码行数:7,代码来源:SchedulesDirect.cs

示例6: UsageEntryPoint

 public UsageEntryPoint(ILogger logger, IApplicationHost applicationHost, INetworkManager networkManager, IHttpClient httpClient)
 {
     _logger = logger;
     _applicationHost = applicationHost;
     _networkManager = networkManager;
     _httpClient = httpClient;
 }
开发者ID:Rycius,项目名称:MediaBrowser,代码行数:7,代码来源:UsageEntryPoint.cs

示例7: PluginCategoryListViewModel

 public PluginCategoryListViewModel(IPresentationManager presentationManager, IInstallationManager installationManager, INavigationService nav, IApplicationHost appHost)
 {
     _presentationManager = presentationManager;
     _installationManager = installationManager;
     _nav = nav;
     _appHost = appHost;
 }
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:7,代码来源:PluginCategoryListViewModel.cs

示例8: Configure

		public virtual void Configure(ulong requestId, int requestNumber, IApplicationHost appHost)
		{
			this.requestId = requestId;
			this.requestNumber = requestNumber;
			this.appHost = appHost;
			this.transport = appHost.AppHostTransport;
		}
开发者ID:qinfengzhu,项目名称:HyperFastCgi,代码行数:7,代码来源:BaseRawRequest.cs

示例9: PluginsPageViewModel

 public PluginsPageViewModel(IApplicationHost appHost, INavigationService nav, IInstallationManager installationManager, IPresentationManager presentationManager)
 {
     _appHost = appHost;
     _nav = nav;
     _installationManager = installationManager;
     _presentationManager = presentationManager;
 }
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:7,代码来源:PluginsPageViewModel.cs

示例10: MainWindow

        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow" /> class.
        /// </summary>
        public MainWindow(ILogger logger, IPlaybackManager playbackManager, IApiClient apiClient, IImageManager imageManager, IApplicationHost appHost, IPresentationManager appWindow, IUserInputManager userInput, ITheaterConfigurationManager config, INavigationService nav, IScreensaverManager screensaverManager)
            : base()
        {
            _logger = logger;
            _appHost = appHost;
            _appWindow = appWindow;
            _config = config;
            _playbackManager = playbackManager;
            UserInputManager = userInput;
            NavigationManager = nav;

            Loaded += MainWindow_Loaded;

            InitializeComponent();

            RotatingBackdrops = new RotatingBackdropsViewModel(apiClient, _config, imageManager, playbackManager, logger, screensaverManager);

            _config.ConfigurationUpdated += _config_ConfigurationUpdated;
            _playbackManager.PlaybackStarted += _playbackManager_PlaybackStarted;
            _playbackManager.PlaybackCompleted += _playbackManager_PlaybackCompleted;

            //Timeline.DesiredFrameRateProperty.OverrideMetadata(
            //    typeof(Timeline),
            //    new FrameworkPropertyMetadata { DefaultValue = 30 }
            //);
        }
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:29,代码来源:MainWindow.xaml.cs

示例11: PluginUpdater

 /// <summary>
 /// Initializes a new instance of the <see cref="PluginUpdater" /> class.
 /// </summary>
 /// <param name="appHost">The app host.</param>
 /// <param name="logger">The logger.</param>
 public PluginUpdater(IApplicationHost appHost, ILogger logger, IApplicationPaths appPaths, ApiClient apiClient)
 {
     _appHost = appHost;
     _logger = logger;
     _appPaths = appPaths;
     _apiClient = apiClient;
 }
开发者ID:EchoDemon,项目名称:MediaBrowser.Theater,代码行数:12,代码来源:PluginUpdater.cs

示例12: StatisticsTask

 /// <summary>
 /// Initializes a new instance of the <see cref="ReloadLoggerFileTask" /> class.
 /// </summary>
 /// <param name="logManager">The logManager.</param>
 /// <param name="appHost"></param>
 /// <param name="httpClient"></param>
 public StatisticsTask(ILogManager logManager, IApplicationHost appHost, INetworkManager networkManager, IHttpClient httpClient)
 {
     LogManager = logManager;
     ApplicationHost = appHost;
     NetworkManager = networkManager;
     HttpClient = httpClient;
 }
开发者ID:jscorrea,项目名称:MediaBrowser,代码行数:13,代码来源:StatisticsTask.cs

示例13: ChannelViewControl

 public ChannelViewControl(IApplicationHost host, string consoleName)
 {
     InitializeComponent();
     Host = host;
     Items = new ChannelViewItemCollection();
     ControlName = consoleName;
 }
开发者ID:netintellect,项目名称:NetOffice,代码行数:7,代码来源:ChannelViewControl.cs

示例14: UsageReporter

 public UsageReporter(IApplicationHost applicationHost, INetworkManager networkManager, IHttpClient httpClient, IUserManager userManager)
 {
     _applicationHost = applicationHost;
     _networkManager = networkManager;
     _httpClient = httpClient;
     _userManager = userManager;
 }
开发者ID:jabbera,项目名称:MediaBrowser,代码行数:7,代码来源:UsageReporter.cs

示例15: InvalidOperationException

 // if appHost is null, we use the site name for the current application
 string IServerConfig.MapPath(IApplicationHost appHost, VirtualPath path) {
     string siteName = (appHost == null) ? _siteNameForCurrentApplication : appHost.GetSiteName();
     string physicalPath = ProcessHostConfigUtils.MapPathActual(siteName, path);
     if (FileUtil.IsSuspiciousPhysicalPath(physicalPath)) {
         throw new InvalidOperationException(SR.GetString(SR.Cannot_map_path, path.VirtualPathString));
     }
     return physicalPath;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:9,代码来源:ProcessHostServerConfig.cs


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