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


C# IAppConfiguration类代码示例

本文整理汇总了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();
        }
开发者ID:ryanspletzer,项目名称:NuGetGallery,代码行数:35,代码来源:ReportPackageRequest.cs

示例2: UserService

 public UserService(
     IAppConfiguration config,
     IEntityRepository<User> userRepository) : this()
 {
     Config = config;
     UserRepository = userRepository;
 }
开发者ID:KuduApps,项目名称:NuGetGallery,代码行数:7,代码来源:UserService.cs

示例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);
        }
开发者ID:jibedoubleve,项目名称:shell,代码行数:28,代码来源:ShellViewModel.cs

示例4: HomeController

 public HomeController(
     Func<IWeeeClient> apiClient,
     IAppConfiguration configuration)
 {
     this.configuration = configuration;
     this.apiClient = apiClient;
 }
开发者ID:EnvironmentAgency,项目名称:prsd-weee,代码行数:7,代码来源:HomeController.cs

示例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;
 }
开发者ID:rhysawilliams2010,项目名称:NuGetGallery,代码行数:31,代码来源:PackagesController.cs

示例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;
 }
开发者ID:whyleee,项目名称:RemoteFeedNuGetGallery,代码行数:26,代码来源:ApiController.cs

示例7: MessageService

 public MessageService(IMailSender mailSender, IAppConfiguration config, AuthenticationService authService)
     : this()
 {
     MailSender = mailSender;
     Config = config;
     AuthService = authService;
 }
开发者ID:atrevisan,项目名称:NuGetGallery,代码行数:7,代码来源:MessageService.cs

示例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;
 }
开发者ID:ryanhartley84332,项目名称:NuGetGallery,代码行数:27,代码来源:PackagesController.cs

示例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));
        }
开发者ID:ashuthinks,项目名称:webnuget,代码行数:33,代码来源:ExternalSearchService.cs

示例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");
        }
开发者ID:Pliner,项目名称:NuGetGallery,代码行数:33,代码来源:DynamicDataManager.cs

示例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);
        }
开发者ID:Pliner,项目名称:NuGetGallery,代码行数:8,代码来源:DynamicDataManager.cs

示例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;
 }
开发者ID:netflakes,项目名称:AzureManagement,代码行数:9,代码来源:AzureManagement.cs

示例13: StatusService

 public StatusService(
     IEntitiesContext entities,
     IFileStorageService fileStorageService,
     IAppConfiguration config)
 {
     _entities = entities;
     _fileStorageService = fileStorageService;
     _config = config;
 }
开发者ID:ashuthinks,项目名称:webnuget,代码行数:9,代码来源:StatusService.cs

示例14: ChargeController

 public ChargeController(
     IAppConfiguration configuration,
     BreadcrumbService breadcrumb,
     Func<IWeeeClient> weeeClient)
 {
     this.configuration = configuration;
     this.breadcrumb = breadcrumb;
     this.weeeClient = weeeClient;
 }
开发者ID:EnvironmentAgency,项目名称:prsd-weee,代码行数:9,代码来源:ChargeController.cs

示例15: SupportRequestService

        public SupportRequestService(
            ISupportRequestDbContext supportRequestDbContext,
            IAppConfiguration config)
        {
            _supportRequestDbContext = supportRequestDbContext;
            _siteRoot = config.SiteRoot;

            _pagerDutyClient = new PagerDutyClient(config.PagerDutyAccountName, config.PagerDutyAPIKey, config.PagerDutyServiceKey);
        }
开发者ID:ZhiYuanHuang,项目名称:NuGetGallery,代码行数:9,代码来源:SupportRequestService.cs


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