• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IAppConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



IAppConfiguration类属于命名空间,在下文中一共展示了IAppConfiguration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: AuthenticationService

        public AuthenticationService(
            IEntitiesContext entities, IAppConfiguration config, IDiagnosticsService diagnostics,
            AuditingService auditing, IEnumerable<Authenticator> providers, ICredentialBuilder credentialBuilder,
            ICredentialValidator credentialValidator, IDateTimeProvider dateTimeProvider)
        {
            if (entities == null)
            {
                throw new ArgumentNullException(nameof(entities));
            }

            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            if (diagnostics == null)
            {
                throw new ArgumentNullException(nameof(diagnostics));
            }

            if (auditing == null)
            {
                throw new ArgumentNullException(nameof(auditing));
            }

            if (providers == null)
            {
                throw new ArgumentNullException(nameof(providers));
            }

            if (credentialBuilder == null)
            {
                throw new ArgumentNullException(nameof(credentialBuilder));
            }

            if (credentialValidator == null)
            {
                throw new ArgumentNullException(nameof(credentialValidator));
            }

            if (dateTimeProvider == null)
            {
                throw new ArgumentNullException(nameof(dateTimeProvider));
            }

            InitCredentialFormatters();

            Entities = entities;
            _config = config;
            Auditing = auditing;
            _trace = diagnostics.SafeGetSource("AuthenticationService");
            Authenticators = providers.ToDictionary(p => p.Name, StringComparer.OrdinalIgnoreCase);
            _credentialBuilder = credentialBuilder;
            _credentialValidator = credentialValidator;
            _dateTimeProvider = dateTimeProvider;
        }
开发者ID:NuGet,项目名称:NuGetGallery,代码行数:56,代码来源:AuthenticationService.cs


示例17: UsersController

 public UsersController(
     IUserService userService,
     IMessageService messageService,
     IAppConfiguration config,
     AuthenticationService authService)
 {
     UserService = userService;
     MessageService = messageService;
     Config = config;
     AuthService = authService;
 }
开发者ID:jpsullivan,项目名称:OSSFinder,代码行数:11,代码来源:UsersController.cs


示例18: UserService

 public UserService(
     IAppConfiguration config,
     IEntityRepository<User> userRepository,
     IEntityRepository<Credential> credentialRepository,
     AuditingService auditing)
     : this()
 {
     Config = config;
     UserRepository = userRepository;
     CredentialRepository = credentialRepository;
     Auditing = auditing;
 }
开发者ID:hugoparedes,项目名称:NuGetGallery,代码行数:12,代码来源:UserService.cs


示例19: UsersController

        public UsersController(
            ICuratedFeedService feedsQuery,
            IUserService userService,
            IPackageService packageService,
            IMessageService messageService,
            IAppConfiguration config,
            AuthenticationService authService,
            ICredentialBuilder credentialBuilder)
        {
            if (feedsQuery == null)
            {
                throw new ArgumentNullException(nameof(feedsQuery));
            }

            if (userService == null)
            {
                throw new ArgumentNullException(nameof(userService));
            }

            if (packageService == null)
            {
                throw new ArgumentNullException(nameof(packageService));
            }

            if (messageService == null)
            {
                throw new ArgumentNullException(nameof(messageService));
            }

            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            if (authService == null)
            {
                throw new ArgumentNullException(nameof(authService));
            }

            if (credentialBuilder == null)
            {
                throw new ArgumentNullException(nameof(credentialBuilder));
            }

            _curatedFeedService = feedsQuery;
            _userService = userService;
            _packageService = packageService;
            _messageService = messageService;
            _config = config;
            _authService = authService;
            _credentialBuilder = credentialBuilder;
        }
开发者ID:rhysawilliams2010,项目名称:NuGetGallery,代码行数:52,代码来源:UsersController.cs


示例20: ProjectsController

 public ProjectsController(
     IProjectService projectService,
     IMessageService messageService,
     IEntitiesContext entitiesContext,
     IAppConfiguration config,
     ICacheService cacheService) 
 {
     _projectService = projectService;
     _messageService = messageService;
     _entitiesContext = entitiesContext;
     _config = config;
     _cacheService = cacheService;
 }
开发者ID:jpsullivan,项目名称:OSSFinder,代码行数:13,代码来源:ProjectsController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IAppDataFolder类代码示例发布时间:2022-05-24
下一篇:
C# IAppBuilder类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap