本文整理汇总了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);
}
示例2: UsageReporter
public UsageReporter(IApplicationHost applicationHost, IHttpClient httpClient, IUserManager userManager, ILogger logger)
{
_applicationHost = applicationHost;
_httpClient = httpClient;
_userManager = userManager;
_logger = logger;
}
示例3: ChannelImageProvider
public ChannelImageProvider(ILiveTvManager liveTvManager, IHttpClient httpClient, ILogger logger, IApplicationHost appHost)
{
_liveTvManager = liveTvManager;
_httpClient = httpClient;
_logger = logger;
_appHost = appHost;
}
示例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;
}
示例5: SchedulesDirect
public SchedulesDirect(ILogger logger, IJsonSerializer jsonSerializer, IHttpClient httpClient, IApplicationHost appHost)
{
_logger = logger;
_jsonSerializer = jsonSerializer;
_httpClient = httpClient;
_appHost = appHost;
}
示例6: UsageEntryPoint
public UsageEntryPoint(ILogger logger, IApplicationHost applicationHost, INetworkManager networkManager, IHttpClient httpClient)
{
_logger = logger;
_applicationHost = applicationHost;
_networkManager = networkManager;
_httpClient = httpClient;
}
示例7: PluginCategoryListViewModel
public PluginCategoryListViewModel(IPresentationManager presentationManager, IInstallationManager installationManager, INavigationService nav, IApplicationHost appHost)
{
_presentationManager = presentationManager;
_installationManager = installationManager;
_nav = nav;
_appHost = appHost;
}
示例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;
}
示例9: PluginsPageViewModel
public PluginsPageViewModel(IApplicationHost appHost, INavigationService nav, IInstallationManager installationManager, IPresentationManager presentationManager)
{
_appHost = appHost;
_nav = nav;
_installationManager = installationManager;
_presentationManager = presentationManager;
}
示例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 }
//);
}
示例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;
}
示例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;
}
示例13: ChannelViewControl
public ChannelViewControl(IApplicationHost host, string consoleName)
{
InitializeComponent();
Host = host;
Items = new ChannelViewItemCollection();
ControlName = consoleName;
}
示例14: UsageReporter
public UsageReporter(IApplicationHost applicationHost, INetworkManager networkManager, IHttpClient httpClient, IUserManager userManager)
{
_applicationHost = applicationHost;
_networkManager = networkManager;
_httpClient = httpClient;
_userManager = userManager;
}
示例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;
}