本文整理汇总了C#中IAppConfiguration类的典型用法代码示例。如果您正苦于以下问题:C# IAppConfiguration类的具体用法?C# IAppConfiguration怎么用?C# IAppConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IAppConfiguration类属于命名空间,在下文中一共展示了IAppConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillIn
internal string FillIn(string subject, IAppConfiguration config)
{
// note, format blocks {xxx} are matched by ordinal-case-sensitive comparison
var builder = new StringBuilder(subject);
Substitute(builder, "{GalleryOwnerName}", config.GalleryOwner.DisplayName);
Substitute(builder, "{Id}", Package.PackageRegistration.Id);
Substitute(builder, "{Version}", Package.Version);
Substitute(builder, "{Reason}", Reason);
if (RequestingUser != null)
{
Substitute(builder, "{User}", String.Format(
CultureInfo.CurrentCulture,
"{2}**User:** {0} ({1}){2}{3}",
RequestingUser.Username,
RequestingUser.EmailAddress,
Environment.NewLine,
Url.User(RequestingUser, scheme: "http")));
}
else
{
Substitute(builder, "{User}", "");
}
Substitute(builder, "{Name}", FromAddress.DisplayName);
Substitute(builder, "{Address}", FromAddress.Address);
Substitute(builder, "{AlreadyContactedOwners}", AlreadyContactedOwners ? "Yes" : "No");
Substitute(builder, "{PackageUrl}", Url.Package(Package.PackageRegistration.Id, null, scheme: "http"));
Substitute(builder, "{VersionUrl}", Url.Package(Package.PackageRegistration.Id, Package.Version, scheme: "http"));
Substitute(builder, "{Reason}", Reason);
Substitute(builder, "{Signature}", Signature);
Substitute(builder, "{Message}", Message);
builder.Replace(@"\{\", "{");
return builder.ToString();
}
示例2: UserService
public UserService(
IAppConfiguration config,
IEntityRepository<User> userRepository) : this()
{
Config = config;
UserRepository = userRepository;
}
示例3: ShellViewModel
public ShellViewModel(IMenuService menuService
, IAppConfiguration appConfiguration
, IUserSettingsService settings)
: base()
{
this.PageLoadingCommand = DelegateCommand.FromAsyncHandler(PageLoading);
this.UserSettingsService = settings;
this.AppName = appConfiguration.AppName;
this.WriteReadyStatus();
this.ToggleFullScreenCommand = new DelegateCommand<object>(o =>
{
if (o is IToggleFullScreen)
{
var tfs = o as IToggleFullScreen;
tfs.ToggleFullScreen = !tfs.ToggleFullScreen;
}
this.ToggleFullScreen = !this.ToggleFullScreen;
});
Menu = menuService.Menu.ToObservableCollection();
EventAggregator.GetEvent<MenuUpdated>().Subscribe(m =>
{
Menu.Clear();
Menu.AddRange(m.ToObservableCollection());
});
EventAggregator.GetEvent<SubMenuVisibilityChanged>().Subscribe(m => this.IsSubMenuVisible = m);
}
示例4: HomeController
public HomeController(
Func<IWeeeClient> apiClient,
IAppConfiguration configuration)
{
this.configuration = configuration;
this.apiClient = apiClient;
}
示例5: PackagesController
public PackagesController(
IPackageService packageService,
IUploadFileService uploadFileService,
IMessageService messageService,
ISearchService searchService,
IAutomaticallyCuratePackageCommand autoCuratedPackageCmd,
IPackageFileService packageFileService,
IEntitiesContext entitiesContext,
IAppConfiguration config,
IIndexingService indexingService,
ICacheService cacheService,
EditPackageService editPackageService,
IPackageDeleteService packageDeleteService,
ISupportRequestService supportRequestService,
AuditingService auditingService)
{
_packageService = packageService;
_uploadFileService = uploadFileService;
_messageService = messageService;
_searchService = searchService;
_autoCuratedPackageCmd = autoCuratedPackageCmd;
_packageFileService = packageFileService;
_entitiesContext = entitiesContext;
_config = config;
_indexingService = indexingService;
_cacheService = cacheService;
_editPackageService = editPackageService;
_packageDeleteService = packageDeleteService;
_supportRequestService = supportRequestService;
_auditingService = auditingService;
}
示例6: ApiController
public ApiController(
IEntitiesContext entitiesContext,
IPackageService packageService,
IPackageFileService packageFileService,
IUserService userService,
INuGetExeDownloaderService nugetExeDownloaderService,
IContentService contentService,
IIndexingService indexingService,
ISearchService searchService,
IAutomaticallyCuratePackageCommand autoCuratePackage,
IStatusService statusService,
IAppConfiguration config)
{
EntitiesContext = entitiesContext;
PackageService = packageService;
PackageFileService = packageFileService;
UserService = userService;
NugetExeDownloaderService = nugetExeDownloaderService;
ContentService = contentService;
StatisticsService = null;
IndexingService = indexingService;
SearchService = searchService;
AutoCuratePackage = autoCuratePackage;
StatusService = statusService;
_config = config;
}
示例7: MessageService
public MessageService(IMailSender mailSender, IAppConfiguration config, AuthenticationService authService)
: this()
{
MailSender = mailSender;
Config = config;
AuthService = authService;
}
示例8: PackagesController
public PackagesController(
IPackageService packageService,
IUploadFileService uploadFileService,
IUserService userService,
IMessageService messageService,
ISearchService searchService,
IAutomaticallyCuratePackageCommand autoCuratedPackageCmd,
INuGetExeDownloaderService nugetExeDownloaderService,
IPackageFileService packageFileService,
IEntitiesContext entitiesContext,
IAppConfiguration config,
IIndexingService indexingService,
ICacheService cacheService)
{
_packageService = packageService;
_uploadFileService = uploadFileService;
_userService = userService;
_messageService = messageService;
_searchService = searchService;
_autoCuratedPackageCmd = autoCuratedPackageCmd;
_nugetExeDownloaderService = nugetExeDownloaderService;
_packageFileService = packageFileService;
_entitiesContext = entitiesContext;
_config = config;
_indexingService = indexingService;
_cacheService = cacheService;
}
示例9: ExternalSearchService
public ExternalSearchService(IAppConfiguration config, IDiagnosticsService diagnostics)
{
ServiceUri = config.ServiceDiscoveryUri;
Trace = diagnostics.SafeGetSource("ExternalSearchService");
// Extract credentials
var userInfo = ServiceUri.UserInfo;
ICredentials credentials = null;
if (!String.IsNullOrEmpty(userInfo))
{
var split = userInfo.Split(':');
if (split.Length != 2)
{
throw new FormatException("Invalid user info in SearchServiceUri!");
}
// Split the credentials out
credentials = new NetworkCredential(split[0], split[1]);
ServiceUri = new UriBuilder(ServiceUri)
{
UserName = null,
Password = null
}.Uri;
}
if (_healthIndicatorStore == null)
{
_healthIndicatorStore = new BaseUrlHealthIndicatorStore(new AppInsightsHealthIndicatorLogger());
}
_client = new SearchClient(ServiceUri, config.SearchServiceResourceType, credentials, _healthIndicatorStore, new TracingHttpHandler(Trace));
}
示例10: InitializeDynamicData
private static void InitializeDynamicData(RouteCollection routes, string root, IAppConfiguration configuration)
{
try
{
DefaultModel.RegisterContext(
new EFCodeFirstDataModelProvider(
() => new EntitiesContext(configuration.SqlConnectionString, readOnly: false)), // DB Admins do not need to respect read-only mode.
configuration: new ContextConfiguration { ScaffoldAllTables = true });
}
catch (SqlException e)
{
QuietLog.LogHandledException(e);
return;
}
catch (DataException e)
{
QuietLog.LogHandledException(e);
return;
}
// This route must come first to prevent some other route from the site to take over
_route = new DynamicDataRoute(root + "/{table}/{action}")
{
Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
Model = DefaultModel
};
routes.Insert(0, _route);
routes.MapPageRoute(
"dd_default",
root,
"~/Areas/Admin/DynamicData/Default.aspx");
}
示例11: Register
public static void Register(RouteCollection routes, string root, IAppConfiguration configuration)
{
// Set up unobtrusive validation
InitializeValidation();
// Set up dynamic data
InitializeDynamicData(routes, root, configuration);
}
示例12: AzureManagement
public AzureManagement(IMlogger logger, IAppConfiguration configuration, IDataExporter dataExporter)
{
Logger = logger;
Configuration = configuration;
var subscriptionId = configuration.SubscriptionId();
var base64EncodedCertificate = configuration.Base64EncodedManagementCertificate();
MyCloudCredentials = getCredentials(subscriptionId, base64EncodedCertificate);
Exporter = dataExporter;
}
示例13: StatusService
public StatusService(
IEntitiesContext entities,
IFileStorageService fileStorageService,
IAppConfiguration config)
{
_entities = entities;
_fileStorageService = fileStorageService;
_config = config;
}
示例14: ChargeController
public ChargeController(
IAppConfiguration configuration,
BreadcrumbService breadcrumb,
Func<IWeeeClient> weeeClient)
{
this.configuration = configuration;
this.breadcrumb = breadcrumb;
this.weeeClient = weeeClient;
}
示例15: SupportRequestService
public SupportRequestService(
ISupportRequestDbContext supportRequestDbContext,
IAppConfiguration config)
{
_supportRequestDbContext = supportRequestDbContext;
_siteRoot = config.SiteRoot;
_pagerDutyClient = new PagerDutyClient(config.PagerDutyAccountName, config.PagerDutyAPIKey, config.PagerDutyServiceKey);
}