本文整理汇总了C#中IAppSettings类的典型用法代码示例。如果您正苦于以下问题:C# IAppSettings类的具体用法?C# IAppSettings怎么用?C# IAppSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IAppSettings类属于命名空间,在下文中一共展示了IAppSettings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RemoteDataService
public RemoteDataService(IDataSource dataSource, IAppSettings appSettings)
{
_appSettings = appSettings;
_dataSource = dataSource;
_httpClient = new HttpClient();
}
开发者ID:Rob-Kachmar,项目名称:Bootcamp,代码行数:7,代码来源:RemoteDataService.cs
示例2: GroupDetailsViewModel
public GroupDetailsViewModel(IAppSettings appSettings, IDataServiceFactory dataServiceFactory, IMvxResourceLoader resourceLoader)
: base(appSettings)
{
_dataServiceFactory = new DataServiceFactory(appSettings, _resourceLoader);
_resourceLoader = resourceLoader;
_groupedItems = new ObservableCollection<Group<Item>>();
}
开发者ID:Rob-Kachmar,项目名称:Bootcamp,代码行数:7,代码来源:GroupDetailsViewModel.cs
示例3: FourSquareOAuth2Provider
public FourSquareOAuth2Provider(IAppSettings appSettings)
: base(appSettings, Realm, Name)
{
this.AuthorizeUrl = this.AuthorizeUrl ?? Realm;
this.AccessTokenUrl = this.AccessTokenUrl ?? "https://foursquare.com/oauth2/access_token";
this.UserProfileUrl = this.UserProfileUrl ?? "https://api.foursquare.com/v2/users/self";
// https://developer.foursquare.com/overview/versioning
DateTime versionDate;
if (!DateTime.TryParse(appSettings.GetString("oauth.{0}.Version".Fmt(Name)), out versionDate))
versionDate = DateTime.UtcNow;
// version dates before June 9, 2012 will automatically be rejected
if (versionDate < new DateTime(2012, 6, 9))
versionDate = DateTime.UtcNow;
this.Version = versionDate;
// Profile Image URL requires dimensions (Width x height) in the URL (default = 64x64 and minimum = 16x16)
int profileImageWidth;
if (!int.TryParse(appSettings.GetString("oauth.{0}.ProfileImageWidth".Fmt(Name)), out profileImageWidth))
profileImageWidth = 64;
this.ProfileImageWidth = Math.Max(profileImageWidth, 16);
int profileImageHeight;
if (!int.TryParse(appSettings.GetString("oauth.{0}.ProfileImageHeight".Fmt(Name)), out profileImageHeight))
profileImageHeight = 64;
this.ProfileImageHeight = Math.Max(profileImageHeight, 16);
Scopes = appSettings.Get("oauth.{0}.Scopes".Fmt(Name), new[] { "basic" });
}
开发者ID:jin29neci,项目名称:ServiceStack,代码行数:33,代码来源:FourSquareOAuth2Provider.cs
示例4: Nemesis
public Nemesis(IAppSettings appSettings)
{
if (appSettings == null)
throw new ArgumentNullException("appSettings");
_value = appSettings.ServiceCallNemesis;
}
开发者ID:yonglehou,项目名称:NsqSharp,代码行数:7,代码来源:Nemesis.cs
示例5: LimitProviderBaseTests
public LimitProviderBaseTests()
{
keyGenerator = A.Fake<ILimitKeyGenerator>();
appSetting = A.Fake<IAppSettings>();
limitProvider = new LimitProviderBase(keyGenerator, appSetting);
}
开发者ID:yonglehou,项目名称:servicestack-ratelimit-redis,代码行数:7,代码来源:LimitProviderBaseTests.cs
示例6: SamlAuthProvider
public SamlAuthProvider(IAppSettings appSettings, string authRealm, string provider, X509Certificate2 signingCert)
{
Logger.Info("SamlAuthProvider Starting up for Realm: {0}, Provider: {1}".Fmt(authRealm, provider));
this.AuthRealm = appSettings != null ? appSettings.Get("SamlRealm", authRealm) : authRealm;
this.Provider = provider;
this.SamlSigningCert = signingCert;
if(appSettings != null)
{
this.CallbackUrl = appSettings.GetString("saml.{0}.CallbackUrl".Fmt(provider)) ?? this.FallbackConfig(appSettings.GetString("saml.CallbackUrl"));
this.IdpInitiatedRedirect = appSettings.GetString("saml.{0}.IdpInitiatedRedirect".Fmt(provider)) ?? this.FallbackConfig(appSettings.GetString("saml.IdpInitiatedRedirect"));
this.RedirectUrl = appSettings.GetString("saml.{0}.RedirectUrl".Fmt(provider)) ?? this.FallbackConfig(appSettings.GetString("saml.RedirectUrl"));
this.LogoutUrl = appSettings.GetString("saml.{0}.LogoutUrl".Fmt(provider)) ?? this.FallbackConfig(appSettings.GetString("saml.LogoutUrl"));
this.Issuer = appSettings.GetString("saml.{0}.Issuer".Fmt(provider)) ?? this.FallbackConfig(appSettings.GetString("saml.Issuer"));
this.AuthorizeUrl = appSettings.GetString("saml.{0}.AuthorizeUrl".Fmt(provider)) ?? this.FallbackConfig(appSettings.GetString("saml.AuthorizeUrl"));
this.SamlResponseFormKey = appSettings.GetString("saml.{0}.ResponseFormKey".Fmt(provider)) ?? this.FallbackConfig(appSettings.GetString("saml.ResponseFormKey"));
Logger.Info("Obtained the following settings from appSettings");
Logger.Info(new
{
this.CallbackUrl,
this.RedirectUrl,
this.LogoutUrl,
this.Issuer,
this.AuthorizeUrl,
this.SamlResponseFormKey
}.ToJson());
}
}
开发者ID:americansystems,项目名称:servicestack-auth-saml,代码行数:29,代码来源:SamlAuthProvider.cs
示例7: AccountSettingsViewModel
public AccountSettingsViewModel(
INavigation navigation,
IAppSettings appSettings)
: base(navigation)
{
this.appSettings = appSettings;
}
开发者ID:kamilkk,项目名称:MyVote,代码行数:7,代码来源:AccountSettingsViewModel.cs
示例8: HomeController
public HomeController(IMessageCounter messageCounter, IDataService dataService, IConfiguration configuration, IAppSettings appSettings)
{
_messageCounter = messageCounter;
_dataService = dataService;
_configuration = configuration;
_appSettings = appSettings;
}
开发者ID:juanonsoftware,项目名称:ionline,代码行数:7,代码来源:HomeController.cs
示例9: MailRuAuthProvider
public MailRuAuthProvider(IAppSettings appSettings)
: base(appSettings, Realm, Name)
{
this.AuthorizeUrl = this.AuthorizeUrl ?? Realm;
this.AccessTokenUrl = this.AccessTokenUrl ?? "https://connect.mail.ru/oauth/token";
this.UserProfileUrl = this.UserProfileUrl ?? "https://www.appsmail.ru/platform/api";
}
开发者ID:AVee,项目名称:ServiceStack,代码行数:7,代码来源:MailRuAuthProvider.cs
示例10: Init
protected virtual void Init(IAppSettings appSettings = null)
{
InitSchema = true;
RequireSecureConnection = true;
Environments = DefaultEnvironments;
KeyTypes = DefaultTypes;
KeySizeBytes = DefaultKeySizeBytes;
CreateApiKeyFn = CreateApiKey;
if (appSettings != null)
{
InitSchema = appSettings.Get("apikey.InitSchema", true);
RequireSecureConnection = appSettings.Get("apikey.RequireSecureConnection", true);
var env = appSettings.GetString("apikey.Environments");
if (env != null)
Environments = env.Split(ConfigUtils.ItemSeperator);
var type = appSettings.GetString("apikey.KeyTypes");
if (type != null)
KeyTypes = type.Split(ConfigUtils.ItemSeperator);
var keySize = appSettings.GetString("apikey.KeySizeBytes");
if (keySize != null)
KeySizeBytes = int.Parse(keySize);
}
ServiceRoutes = new Dictionary<Type, string[]>
{
{ typeof(GetApiKeysService), new[] { "/apikeys", "/apikeys/{Environment}" } },
{ typeof(RegenrateApiKeysService), new [] { "/apikeys/regenerate", "/apikeys/regenerate/{Environment}" } },
};
}
开发者ID:migajek,项目名称:ServiceStack,代码行数:33,代码来源:ApiKeyAuthProvider.cs
示例11: AppConfig
public AppConfig(IAppSettings appSettings)
{
this.Env = appSettings.Get("Env", Env.Local);
this.EnableCdn = appSettings.Get("EnableCdn", false);
this.CdnPrefix = appSettings.Get("CdnPrefix", "");
this.AdminUserNames = appSettings.Get("AdminUserNames", new List<string>());
}
开发者ID:rjaydadula,项目名称:SocialBootstrapApi,代码行数:7,代码来源:AppConfig.cs
示例12: FacebookAuthProvider
public FacebookAuthProvider(IAppSettings appSettings)
: base(appSettings, Realm, Name, "AppId", "AppSecret")
{
this.AppId = appSettings.GetString("oauth.facebook.AppId");
this.AppSecret = appSettings.GetString("oauth.facebook.AppSecret");
this.Permissions = appSettings.Get("oauth.facebook.Permissions", new string[0]);
}
开发者ID:jlyonsmith,项目名称:ServiceStack,代码行数:7,代码来源:FacebookAuthProvider.cs
示例13: ConfigureDatabase
public static FluentConfiguration ConfigureDatabase(this FluentConfiguration config, IAppSettings appSettings)
{
#if DEBUG
return config.DebugDatabase();
#endif
return config.ProductionDatabase();
}
开发者ID:caiokf,项目名称:smart-track,代码行数:7,代码来源:NHibernateConfiguration.cs
示例14: AdministrationViewModel
public AdministrationViewModel(ICustomAppearanceManager appearanceManager, IAppSettings appSettings)
{
this.appearanceManager = appearanceManager;
this.appSettings = appSettings;
selectedAccentColor = appearanceManager.AccentColor;
selectedTextColor = appearanceManager.TextColor;
}
开发者ID:silverforge,项目名称:TwitterClient,代码行数:7,代码来源:AdministrationViewModel.cs
示例15: GithubAuthProvider
public GithubAuthProvider(IAppSettings appSettings)
: base(appSettings, Realm, Name, "ClientId", "ClientSecret")
{
ClientId = appSettings.GetString("oauth.github.ClientId");
ClientSecret = appSettings.GetString("oauth.github.ClientSecret");
Scopes = appSettings.Get("oauth.github.Scopes", new[] { "user" });
}
开发者ID:vebin,项目名称:soa,代码行数:7,代码来源:GithubAuthProvider.cs
示例16: Setup
public void Setup()
{
var tcb = new TestControllerBuilder();
context = new AuthorizationContext {HttpContext = tcb.HttpContext};
appSettings = MockRepository.GenerateStub<IAppSettings>();
filter = new EnsureSsl(appSettings);
}
开发者ID:sthapa123,项目名称:sutekishop,代码行数:7,代码来源:EnsureSslFilterTester.cs
示例17: TodoModule
public TodoModule(IAppSettings appSettings, ITodoService todoService, IServiceBus bus)
{
_todoService = todoService;
_bus = bus;
Post["/todo"] = _ =>
{
var slashCommand = this.Bind<SlashCommand>();
if (slashCommand == null ||
slashCommand.command.Missing())
{
Log.Info("Rejected an incoming slash command (unable to parse request body).");
return HttpStatusCode.BadRequest.WithReason("Unable to parse slash command.");
}
if (!appSettings.Get("todo:slackSlashCommandToken").Equals(slashCommand.token))
{
Log.Info("Blocked an unauthorized slash command.");
return HttpStatusCode.Unauthorized.WithReason("Missing or invalid token.");
}
if (!slashCommand.command.Equals("/todo", StringComparison.InvariantCultureIgnoreCase))
{
Log.Info("Rejected an incoming slash command ({0} is not handled by this module).", slashCommand.command);
return HttpStatusCode.BadRequest.WithReason("Unsupported slash command.");
}
var responseText = HandleTodo(slashCommand);
if (responseText.Missing())
{
return HttpStatusCode.OK;
}
return responseText;
};
}
开发者ID:rapidexpert,项目名称:SlackCommander,代码行数:33,代码来源:TodoModule.cs
示例18: LoginViewModel
public LoginViewModel(IAuthenticationService authenticationService, IAppSettings appSettings, IDialogService dialogService, IStatisticsService statisticsService)
{
_authenticationService = authenticationService;
_appSettings = appSettings;
_dialogService = dialogService;
_statisticsService = statisticsService;
}
开发者ID:thewindev,项目名称:Toastmaster-Tools,代码行数:7,代码来源:LoginViewModel.cs
示例19: YammerAuthProvider
/// <summary>
/// Initializes a new instance of the <see cref="YammerAuthProvider"/> class.
/// </summary>
/// <param name="appSettings">
/// The application settings (in web.config).
/// </param>
public YammerAuthProvider(IAppSettings appSettings)
: base(appSettings, appSettings.GetString("oauth.yammer.Realm"), Name, "ClientId", "AppSecret")
{
this.ClientId = appSettings.GetString("oauth.yammer.ClientId");
this.ClientSecret = appSettings.GetString("oauth.yammer.ClientSecret");
this.PreAuthUrl = appSettings.GetString("oauth.yammer.PreAuthUrl");
}
开发者ID:GDBSD,项目名称:ServiceStack,代码行数:13,代码来源:YammerAuthProvider.cs
示例20: HexBoxFileTabContentCreator
HexBoxFileTabContentCreator(Lazy<IHexDocumentManager> hexDocumentManager, IMenuManager menuManager, IHexEditorSettings hexEditorSettings, IAppSettings appSettings, Lazy<IHexBoxUndoManager> hexBoxUndoManager) {
this.hexDocumentManager = hexDocumentManager;
this.menuManager = menuManager;
this.hexEditorSettings = hexEditorSettings;
this.appSettings = appSettings;
this.hexBoxUndoManager = hexBoxUndoManager;
}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:7,代码来源:HexBoxFileTabContent.cs
注:本文中的IAppSettings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论