本文整理汇总了C#中IAppSettings类的典型用法代码示例。如果您正苦于以下问题:C# IAppSettings类的具体用法?C# IAppSettings怎么用?C# IAppSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IAppSettings类属于命名空间,在下文中一共展示了IAppSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoteDataService
public RemoteDataService(IDataSource dataSource, IAppSettings appSettings)
{
_appSettings = appSettings;
_dataSource = dataSource;
_httpClient = new HttpClient();
}
示例2: GroupDetailsViewModel
public GroupDetailsViewModel(IAppSettings appSettings, IDataServiceFactory dataServiceFactory, IMvxResourceLoader resourceLoader)
: base(appSettings)
{
_dataServiceFactory = new DataServiceFactory(appSettings, _resourceLoader);
_resourceLoader = resourceLoader;
_groupedItems = new ObservableCollection<Group<Item>>();
}
示例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" });
}
示例4: Nemesis
public Nemesis(IAppSettings appSettings)
{
if (appSettings == null)
throw new ArgumentNullException("appSettings");
_value = appSettings.ServiceCallNemesis;
}
示例5: LimitProviderBaseTests
public LimitProviderBaseTests()
{
keyGenerator = A.Fake<ILimitKeyGenerator>();
appSetting = A.Fake<IAppSettings>();
limitProvider = new LimitProviderBase(keyGenerator, appSetting);
}
示例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());
}
}
示例7: AccountSettingsViewModel
public AccountSettingsViewModel(
INavigation navigation,
IAppSettings appSettings)
: base(navigation)
{
this.appSettings = appSettings;
}
示例8: HomeController
public HomeController(IMessageCounter messageCounter, IDataService dataService, IConfiguration configuration, IAppSettings appSettings)
{
_messageCounter = messageCounter;
_dataService = dataService;
_configuration = configuration;
_appSettings = appSettings;
}
示例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";
}
示例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}" } },
};
}
示例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>());
}
示例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]);
}
示例13: ConfigureDatabase
public static FluentConfiguration ConfigureDatabase(this FluentConfiguration config, IAppSettings appSettings)
{
#if DEBUG
return config.DebugDatabase();
#endif
return config.ProductionDatabase();
}
示例14: AdministrationViewModel
public AdministrationViewModel(ICustomAppearanceManager appearanceManager, IAppSettings appSettings)
{
this.appearanceManager = appearanceManager;
this.appSettings = appSettings;
selectedAccentColor = appearanceManager.AccentColor;
selectedTextColor = appearanceManager.TextColor;
}
示例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" });
}