private static bool IsNewerAppVersion(BaseSettings settings) { var currentVersion = PhoneInteraction.GetAppVersion(); var storedVersion = settings.AppVersion; return string.Compare(currentVersion, storedVersion, StringComparison.Ordinal) > 0; }
private async Task <bool> Interaction() { if (InteractionObject != null && InteractionObject.IsValid) { if (entryId == 0) { entryId = InteractionObject.Entry; } GarrisonBase.Log("Activating " + InteractionObject.Name + ", waiting..."); InteractionObject.Interact(); await CommonCoroutines.SleepForRandomUiInteractionTime(); await Coroutine.Wait(5000, () => !StyxWoW.Me.IsCasting && !InteractionObject.IsValid); await Coroutine.Sleep(StyxWoW.Random.Next(1999, 3001)); return(true); } Building.CanActivate = false; if (Building.Type == BuildingType.HerbGarden || Building.Type == BuildingType.Mines) {//Since activating herb/mine building resets the nodes, we should reset our last checked so we can redo it.. if (Building.Type == BuildingType.HerbGarden) { BaseSettings.CurrentSettings.LastCheckedHerbString = "0001-01-01T00:00:00"; } else { BaseSettings.CurrentSettings.LastCheckedMineString = "0001-01-01T00:00:00"; } BaseSettings.SerializeToXML(BaseSettings.CurrentSettings); } return(false); }
/// <summary> /// Storing base settings. /// </summary> /// <param name="bs"></param> public void StoreBaseSettings(BaseSettings bs) { BaseSettings bsOld = GetBaseSettings(); using (DbTransaction tra = DataAccess.Instance.Connection.BeginTransaction()) { using (SQLiteCommand cmd = (SQLiteCommand)DataAccess.Instance.Connection.CreateCommand()) { StringBuilder sql = new StringBuilder(); sql.Append("update ").Append(Tables.BASE_SETTINGS).Append(" "); sql.Append("set ").Append(Columns.BASE_SETTINGS.SHUTDOWN_COMMAND).Append(" = @shutdownCommand, "); sql.Append(Columns.BASE_SETTINGS.CHECK_INTERVAL).Append(" = @checkInterval, "); sql.Append(Columns.BASE_SETTINGS.SERVICE_URL).Append(" = @serviceUrl, "); sql.Append(Columns.BASE_SETTINGS.DELAY_START).Append(" = @delayStart"); cmd.CommandText = sql.ToString(); cmd.Parameters.Add("shutdownCommand", DbType.String).Value = bs.ShutdownCommand; cmd.Parameters.Add("checkInterval", DbType.Int32).Value = bs.CheckInterval; cmd.Parameters.Add("serviceUrl", DbType.String).Value = bs.UrlService; cmd.Parameters.Add("delayStart", DbType.Int32).Value = bs.DelayStart; int rows = cmd.ExecuteNonQuery(); if (rows == 0) { throw new InvalidOperationException("Could not update BASE SETTINGS."); } else if (rows > 1) { throw new InvalidOperationException("Too many rows updated in BASE SETTINGS."); } } tra.Commit(); ParentControlFactory.Instance.RestartScheduler(); } }
public BaseSettings GetNotificationSettings(string userId, string appKey) { try { this.OpenSession(userName); ApplicationData appData = session.ReadApplicationData(userId, appKey); XElement xSettings = XElement.Parse(Encoding.UTF8.GetString(appData.Data)); BaseSettings settings = new BaseSettings(); settings.SavedDate = xSettings.Element("SavedDate").Value; settings.UserId = xSettings.Element("UserId").Value; return(settings); } catch (Exception ex) { throw ex; } finally { this.CloseSession(); } }
public void SaveNotificationSettings(BaseSettings settings, string appKey) { try { this.OpenSession(); ApplicationData appData = new ApplicationData(); appData.ApplicationId = appKey; XElement xSettings = new XElement("appKey"); xSettings.Add(new XElement("SavedDate", settings.SavedDate)); xSettings.Add(new XElement("UserId", settings.UserId)); appData.Data = Encoding.UTF8.GetBytes(xSettings.ToString()); session.SaveApplicationData(settings.UserId, new ApplicationData[] { appData }); } catch (Exception ex) { throw ex; } finally { this.CloseSession(); } }
private void BindServices(ContainerBuilder builder, BaseSettings settings) { var redis = new RedisCache(new RedisCacheOptions { Configuration = settings.CacheSettings.RedisConfiguration, InstanceName = settings.CacheSettings.FinanceDataCacheInstance }); builder.RegisterInstance(redis).As <IDistributedCache>().SingleInstance(); builder.RegisterType <OrderBooksService>() .As <IOrderBooksService>() .WithParameter(TypedParameter.From(settings.CacheSettings)) .SingleInstance(); builder.RegisterType <KycStatusValidator>() .AsSelf(); builder.RegisterType <KycCountryValidator>() .AsSelf(); builder.RegisterType <MarketDataCacheService>() .As <IStartable>() .AsSelf() .AutoActivate() .SingleInstance(); builder.RegisterInstance(settings.SessionCheck); builder.RegisterInstance(_apiSettings.CurrentValue.BlockedWithdrawalSettings); builder.RegisterType <SiriusWalletsService>() .As <ISiriusWalletsService>() .WithParameter(TypedParameter.From(_apiSettings.CurrentValue.SiriusApiServiceClient.BrokerAccountId)) .WithParameter(TypedParameter.From(_apiSettings.CurrentValue.SiriusApiServiceClient.WalletsActiveRetryCount)) .WithParameter(TypedParameter.From(_apiSettings.CurrentValue.SiriusApiServiceClient.WaitForActiveWalletsTimeout)) .SingleInstance(); }
public SrvKycManager(IKycDocumentsRepository kycDocumentsRepository, IKycDocumentsScansRepository kycDocumentsScansRepository, IKycRepository kycRepository, IMenuBadgesRepository menuBadgesRepository, IPersonalDataRepository personalDataRepository, IClientAccountsRepository clientAccountsRepository, IAuditLogRepository auditLogRepository, IRegistrationLogs registrationLogs, IClientSettingsRepository clientSettingsRepository, ISrvBlockchainHelper srvBlockchainHelper, BaseSettings baseSettings, IAppGlobalSettingsRepositry appGlobalSettingsRepositry, IAssetGroupRepository assetGroupRepository, ISrvEmailsFacade srvEmailsFacade, IBackgroundWorkRequestProducer backgroundWorkRequestProducer) { _kycDocumentsRepository = kycDocumentsRepository; _kycDocumentsScansRepository = kycDocumentsScansRepository; _kycRepository = kycRepository; _menuBadgesRepository = menuBadgesRepository; _personalDataRepository = personalDataRepository; _clientAccountsRepository = clientAccountsRepository; _auditLogRepository = auditLogRepository; _registrationLogs = registrationLogs; _clientSettingsRepository = clientSettingsRepository; _srvBlockchainHelper = srvBlockchainHelper; _baseSettings = baseSettings; _appGlobalSettingsRepositry = appGlobalSettingsRepositry; _assetGroupRepository = assetGroupRepository; _srvEmailsFacade = srvEmailsFacade; _backgroundWorkRequestProducer = backgroundWorkRequestProducer; }
public override void ChangeLanguage() { try { string[] m_def_en = new string[] { " READ DEMO ", " BASE SETTINGS ", " SENIOR SETTINGS ", " ISO18000-6B READ&&WRITE ", " EPC(GEN 2) READ&&WRITE ", " WIFI SETTINGS " }; string[] m_def_cn = new string[] { "读卡演示", "基本参数", "高级参数", "ISO18000-6B 读写操作", "EPC(GEN 2) 读写操作", "WIFI参数" }; string[] m_def_tw = new string[] { "讀卡演示", "基本參數", "高級參數", "ISO18000-6B 讀寫操作", "EPC(GEN 2) 讀寫操作", "WIFI參數" }; string[] MainValue = BaseSettings.LoadLanguage(@"passive/passive", m_def_en, m_def_cn, m_def_tw); int index = 0; tabReadDemo.Text = MainValue[index++]; tabBaseSettings.Text = MainValue[index++]; tabSeniorSettings.Text = MainValue[index++]; tabWriteISO.Text = MainValue[index++]; tabWriteEPC.Text = MainValue[index++]; tabWifiSettings.Text = MainValue[index++]; } catch { } ChangeFont(this); ucPBaseSettings1.ChangeLanguage(); ucPSeniorSettings1.ChangeLanguage(); ucPReadDemo1.ChangeLanguage(); ucPWriteISO1.ChangeLanguage(); ucPWriteEPC1.ChangeLanguage(); ucPWifiSettings1.ChangeLanguage(); }
public MessageMiddlePlain(BaseSettings baseSettings, Verifyer verifyer) { _baseSettings = baseSettings; _verify = verifyer; }
public static IServiceCollection ConfigureDataProtection( this IServiceCollection services, BaseSettings baseSettings) { if (baseSettings.DataProtectionSettings.UseDataProtection) { if (string.IsNullOrWhiteSpace(baseSettings.DataProtectionSettings.ApplicationName)) { throw new ArgumentNullException("ApplicationName", "You must supply an ApplicationName in DataProtectionSettings"); } var dataProtection = services.AddDataProtection(); dataProtection.SetApplicationName(baseSettings.DataProtectionSettings.ApplicationName); if (baseSettings.DataProtectionSettings.DataProtectionStorage == DataProtectionStorage.Redis) { if (string.IsNullOrWhiteSpace(baseSettings.DataProtectionSettings.RedisConnection)) { throw new ArgumentNullException("BaseSettings.DataProtectionSettings.RedisConnection", "You need to supply a connection string for redis"); } var redis = ConnectionMultiplexer.Connect(baseSettings.DataProtectionSettings.RedisConnection); dataProtection.PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys"); } if (baseSettings.DataProtectionSettings.DataProtectionStorage == DataProtectionStorage.FileSystem && !string.IsNullOrWhiteSpace(baseSettings.DataProtectionSettings.DataProtectionStoragePath)) { dataProtection.PersistKeysToFileSystem(new DirectoryInfo(baseSettings.DataProtectionSettings.DataProtectionStoragePath)); } if (baseSettings.DataProtectionSettings.UseX509 && (string.IsNullOrWhiteSpace(baseSettings.DataProtectionSettings.CertificatePath) || string.IsNullOrWhiteSpace(baseSettings.DataProtectionSettings.Password))) { throw new Exception("If UseX509 is true you must supply a CertificatePath and Password"); } if (baseSettings.DataProtectionSettings.UseX509 && !string.IsNullOrWhiteSpace(baseSettings.DataProtectionSettings.CertificatePath) && !string.IsNullOrWhiteSpace(baseSettings.DataProtectionSettings.Password)) { /* * https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/?view=aspnetcore-2.1 * https://github.com/aspnet/DataProtection * https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/compatibility/replacing-machinekey?view=aspnetcore-2.1 * http://www.paraesthesia.com/archive/2016/06/15/set-up-asp-net-dataprotection-in-a-farm/ * Create crt and key in ubuntu bash: * openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:4096 -keyout privateKey.key -out certificate.crt * * Create PFX from crt and key * openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt * * Add the cert to the certmgr local machine - you can get it at: C:\Users\{UserName}\AppData\Local\lxss\root * */ var bytes = File.ReadAllBytes(baseSettings.DataProtectionSettings.CertificatePath); X509Certificate2 x509Cert = new X509Certificate2(bytes, baseSettings.DataProtectionSettings.Password); dataProtection.ProtectKeysWithCertificate(x509Cert); } } return(services); }
public MessageMiddlePlain(BaseSettings baseSettings) { _baseSettings = baseSettings; }
//TODO: Add proper parameters public Facebook(FederatedAuthenticationConfiguration federatedAuthenticationConfiguration, ICookieManager cookieManager, BaseSettings baseSettings) : base(federatedAuthenticationConfiguration, cookieManager, baseSettings) { }
public SrvReferralCodeFinder(BaseSettings baseSettings) { _baseSettings = baseSettings; }
public bool Save(BaseSettings settings, string path) => true;
public AzureADIdentityProviderProcessor(FederatedAuthenticationConfiguration federatedAuthenticationConfiguration, ICookieManager cookieManager, BaseSettings settings) : base(federatedAuthenticationConfiguration, cookieManager, settings) { }
public ApiModule(BaseSettings settings, IReloadingManager <DbSettings> db, ILog log) { _settings = settings; _dbSettingsManager = db; _log = log; }
public UpdaterInfoArgs(UpdaterResponse updaterResponse, BaseSettings settings) { UpdateInfo = updaterResponse; Settings = settings; }
public AddNewChangeAddressFunction(IQBitNinjaApiCaller qBitNinjaApiCaller, CachedDataDictionary <string, IAssetSetting> assetSettingCache, ISettingsRepository settingsRepository, ISignatureApiProvider signatureApiProvider, BaseSettings baseSettings, IAssetSettingRepository assetSettingRepository, ILog logger, CachedDataDictionary <string, IAsset> assetRepository, RpcConnectionParams connectionParams, IWalletService walletService) { _qBitNinjaApiCaller = qBitNinjaApiCaller; _assetSettingCache = assetSettingCache; _settingsRepository = settingsRepository; _baseSettings = baseSettings; _assetSettingRepository = assetSettingRepository; _logger = logger; _assetRepository = assetRepository; _connectionParams = connectionParams; _walletService = walletService; _signatureApiProvider = signatureApiProvider; }
/// <summary> /// Loads a new setting option to the form /// </summary> /// <param name="name">Name of setting control</param> /// <param name="description">Description of setting</param> /// <param name="parent">Parent tree node, or null if no parent</param> /// <param name="settingsPanel">Settings Panel to be shown when user selects the setting</param> /// <returns>TreeNode item which controls the settings panel</returns> public TreeNode LoadControlOption(string name, string description, TreeNode parent, BaseSettings settingsPanel) { TreeNode Result = null; if (parent == null) { Result = tvOptions.Nodes.Add(name); } else { Result = parent.Nodes.Add(name); } Setting setting = new Setting(name, description, settingsPanel); _settings.Add(Result, setting); settingsPanel.SettingsParentForm = this; settingsPanel.SettingsLoaded(); settingsPanel.TreeNode = Result; return(Result); }
public ConfigureLogger(BaseSettings settings) { this.settings = settings; }
public override async Task <bool> BehaviorRoutine() { if (await base.BehaviorRoutine()) { return(true); } if (IsDone) { return(false); } // ObjectCacheManager.UpdateLootableTarget(); if (_movement == null || _movement.CurrentMovementQueue.Count == 0) { if (_movementQueue.Count > 0) { //while (_movementQueue.Count > 0) //{ // if (ObjectCacheManager.GetGameObjectsNearPoint(_movementQueue.Peek(), 50f, WoWObjectTypes.OreVein).Count==0) // { // GarrisonBase.Debug("Dequeueing point from mine movement!"); // _movementQueue.Dequeue(); // continue; // } // break; //} if (_movementQueue.Count > 0) { _movement = new Movement(_movementQueue.Dequeue(), 5f, name: "Mining"); TargetManager.LootDistance += 10f; } } } if (ObjectCacheManager.FoundOreObject) { if (_movementQueue.Count > 0) { if (_movement != null) { if (await _movement.MoveTo()) { return(true); } } return(true); } } if (await EndMovement.MoveTo()) { return(true); } BaseSettings.CurrentSettings.LastCheckedMineString = LuaCommands.GetGameTime().ToString("yyyy-MM-ddTHH:mm:ss"); BaseSettings.SerializeToXML(BaseSettings.CurrentSettings); TargetManager.ShouldLoot = false; return(false); }
public ShotrImageUploader(BaseSettings settings) { _settings = settings; }
public OAuthInterfaceCaller(BaseSettings weixinSetting) { _restClient = new RestClient(WeixinUri); _weixinSetting = weixinSetting; }
internal void Save() { BaseSettings.Save(); }
public ServiceModule(IReloadingManager <AppSettings> settings) { _settings = settings.Nested(x => x.CustomerApiService).CurrentValue; _mobileSettings = settings.Nested(x => x.MobileAppSettings).CurrentValue; }
public WxPayService(BaseSettings baseSettings, WxPayInterfaceCaller wxPayInterfaceCaller) { _baseSettings = baseSettings; _wxPayInterfaceCaller = wxPayInterfaceCaller; }
public abstract void SaveSettings(BaseSettings settings);
public BaseSettings?Load(BaseSettings settings, string path) => settings;
public abstract void ResetSettings(BaseSettings settings);
public abstract void OverrideSettings(BaseSettings settings);