public CreateAccountUseCase( IStateManager stateManager, IIdGenerator idGenerator, CurrencyConfiguration currencyConfig) { _stateManager = stateManager; _idGenerator = idGenerator; _currencyConfig = currencyConfig; }
public StateController( ILogger <StateController> logger, ReadStateUseCase readUseCase, ResetStateUseCase resetUseCase, CurrencyConfiguration currencyConfig) { _logger = logger; _readUseCase = readUseCase; _resetUseCase = resetUseCase; _currencyConfig = currencyConfig; }
public MarketCurrencyCandleCollector( ILogger <MarketCurrencyCandleCollector> logger, CurrencyConfiguration currencyConfig, CurrencyPriceManager priceManager, CurrencyIntervalCalculator intervalCalculator) { _logger = logger; _currencyConfig = currencyConfig; _priceManager = priceManager; _intervalCalculator = intervalCalculator; }
public DashboardManager( ILogger <DashboardManager> logger, IDashboardRepository repository, AssetTagManager tagManager, MetadataManager metadataManager, ExchangeManager exchangeManager, CurrencyConfiguration currencyConfig) { _logger = logger; _repository = repository; _tagManager = tagManager; _metadataManager = metadataManager; _exchangeManager = exchangeManager; _currencyConfig = currencyConfig; }
public ReadVirtualStateUseCase( ILogger <ReadVirtualStateUseCase> logger, IStateManager stateManager, MetadataManager metadataManager, CurrencyConfiguration currencyConfig, AssetPriceManager priceManager, ExchangeManager exchangeManager) { _logger = logger; _stateManager = stateManager; _metadataManager = metadataManager; _currencyConfig = currencyConfig; _priceManager = priceManager; _exchangeManager = exchangeManager; }
public Configuration(bool showOnOffer, string leagueName, List <string> targetTitles, int textBoxDelay, CurrencyConfiguration currencyConfiguration, ItemConfiguration itemConfiguration) { ShowOnOffer = showOnOffer; LeagueName = leagueName; TargetTitles = targetTitles; TextBoxDelay = textBoxDelay; CurrencyConfiguration = currencyConfiguration; ItemConfiguration = itemConfiguration; foreach (var currentSearchItem in itemConfiguration.CurrentItemSearches) { currentSearchItem.SearchEngine.Start(); } }
public void Map_Entity_Success() { // Arrange const string schemaName = "dbo"; const string tableName = "Currency"; var currencyConfiguration = new CurrencyConfiguration(schemaName); var modelBuilder = new ModelBuilder(new ConventionSet()); var entityTypeBuilder = modelBuilder.Entity <CurrencyEntity>(); // Act currencyConfiguration.Map(entityTypeBuilder); // Assert CheckTable(entityTypeBuilder, schemaName, tableName); CheckId(entityTypeBuilder); CheckAlphabeticCode(entityTypeBuilder, 3); }
public InvoiceController(IHostingEnvironment _env, IConfiguration _configuration, CurrencyConfiguration _currencyConfiguration) { env = _env; configuration = _configuration; currencyConfiguration = _currencyConfiguration; }
internal void LoadConfiguration() { var doc = new XmlDocument(); doc.Load(this.path); string section = null; try { { section = "chat-server/addr"; var chatAddressNode = doc.SelectSingleNode("configuration/chat-server/addr"); this.ChatServerAddress = this.parseAddress(chatAddressNode.Attributes["ip"].InnerText); this.ChatServerPort = Convert.ToInt32(chatAddressNode.Attributes["port"].InnerText); section = "chat-server/player-inactivity-timeout"; var playerInactivityTimeoutNode = doc.SelectSingleNode("configuration/chat-server/player-inactivity-timeout"); this.PlayerInactivityTimeout = Convert.ToInt32(playerInactivityTimeoutNode.Attributes["seconds"].InnerText); } { section = "chat-server/permanent-rooms"; var permanentRoomsNode = doc.SelectSingleNode("configuration/chat-server/permanent-rooms"); this.PermanentRooms = new List <PermanentRoom>(); if (permanentRoomsNode != null) { foreach (var nodeElement in permanentRoomsNode.ChildNodes) { var node = nodeElement as XmlNode; var modAttribute = node.Attributes["mods"]; var radioAttribute = node.Attributes["radio-url"]; var promptAttribute = node.Attributes["prompt"]; string radioUrl = null; if (radioAttribute != null) { radioUrl = radioAttribute.InnerText; } string[] modNames = new string[0]; if (modAttribute != null) { modNames = modAttribute.InnerText.Split(',').Select((a) => a.Trim()).ToArray(); } string prompt = null; if (promptAttribute != null) { prompt = String.Join("\n", promptAttribute.InnerText.Split('\\')); } this.PermanentRooms.Add(new PermanentRoom { Identifier = node.Attributes["identifier"].InnerText, Name = node.Attributes["name"].InnerText, Owner = node.Attributes["owner"].InnerText, RadioURL = radioUrl, Prompt = prompt, Moderators = modNames, }); } } } { section = "chat-server/expel"; var expelNode = doc.SelectSingleNode("configuration/chat-server/expel"); var maxDurationMinutes = Convert.ToUInt32(expelNode.Attributes["maximum-duration"].InnerText); this.Expel = new ExpelConfiguration { Enabled = expelNode.Attributes["enabled"].InnerText.Equals("true"), MaxDuration = TimeSpan.FromMinutes(maxDurationMinutes), }; } { section = "chat-server/dangling-user-rooms"; var danglingLocationNode = doc.SelectSingleNode("configuration/chat-server/dangling-user-rooms"); var timeoutMinutes = Convert.ToUInt32(danglingLocationNode.Attributes["timeout"].InnerText); this.DanglingRoom = new DanglingRoomConfiguration { Enabled = danglingLocationNode.Attributes["enabled"].InnerText.Equals("true"), Timeout = TimeSpan.FromMinutes(timeoutMinutes), }; } { section = "chat-server/prompt"; var node = doc.SelectSingleNode("configuration/chat-server/prompt"); if (node != null) { this.ServerPromptPeriod = Convert.ToUInt32(node.Attributes["show-each"].InnerText); this.ServerPromptText = node.InnerText; } } { section = "chat-server/chat-intermessage-intervals"; var node = doc.SelectSingleNode("configuration/chat-server/chat-intermessage-intervals"); this.WorldChatIntermessageInterval = TimeSpan.FromSeconds(Convert.ToDouble(node.Attributes["world"].InnerText)); this.LocalChatIntermessageInterval = TimeSpan.FromSeconds(Convert.ToDouble(node.Attributes["local"].InnerText)); } { section = "rest-api-server/addr"; var restApiAddressNode = doc.SelectSingleNode("configuration/rest-api-server/addr"); this.RestAPIServerAddress = this.parseAddress(restApiAddressNode.Attributes["ip"].InnerText); this.RestAPIServerPort = Convert.ToInt32(restApiAddressNode.Attributes["port"].InnerText); section = "rest-api-server/cross-origin"; var crossOriginNode = doc.SelectSingleNode("configuration/rest-api-server/cross-origin"); this.CrossOriginAddress = this.parseAddress(crossOriginNode.Attributes["allow-ip"].InnerText); if (crossOriginNode.Attributes["port"] != null) { this.CrossOriginPort = Convert.ToInt32(crossOriginNode.Attributes["port"].InnerText); } else { this.CrossOriginPort = 0; } { section = "rest-api-server/currency"; var currencyNode = doc.SelectSingleNode("configuration/rest-api-server/currency"); this.Currency = new CurrencyConfiguration { Enabled = currencyNode.Attributes["enabled"].InnerText.Equals("true"), Padding = Convert.ToUInt32(currencyNode.Attributes["padding"].InnerText), BonusPerHourOnline = Convert.ToUInt32(currencyNode.Attributes["bonus-per-hour-online"].InnerText), SoftCap = Convert.ToInt32(currencyNode.Attributes["soft-cap"].InnerText), WorldChatCost = Convert.ToInt32(currencyNode.Attributes["world-chat-cost"].InnerText), }; } { section = "rest-api-server/worlds"; var worldCacheNode = doc.SelectSingleNode("configuration/rest-api-server/worlds"); this.Worlds = new WorldsConfiguration { RamCacheCapacity = Convert.ToUInt32(worldCacheNode.Attributes["ram-cache-capacity"].InnerText), }; } { section = "rest-api-server/photos"; var photosNode = doc.SelectSingleNode("configuration/rest-api-server/photos"); this.PlayerDefaultPhotoSlots = Convert.ToUInt32(photosNode.Attributes["default-slot-count"].InnerText); this.PlayerMaxPhotoSlots = Convert.ToUInt32(photosNode.Attributes["max-slot-count"].InnerText); this.PhotoSizeLimit = Convert.ToUInt32(photosNode.Attributes["size-limit"].InnerText); } section = "rest-api-server/radiostations"; var radiostationsNodes = doc.SelectSingleNode("configuration/rest-api-server/radiostations"); if (radiostationsNodes != null) { this.Radiostations = new Dictionary <string, string>(); foreach (var nodeElement in radiostationsNodes.ChildNodes) { var node = nodeElement as XmlNode; var lobbyId = node.Attributes["id"].InnerText; var url = node.Attributes["url"].InnerText; this.Radiostations[lobbyId] = url; } } { section = "rest-api-server/mail"; var mailNode = doc.SelectSingleNode("configuration/rest-api-server/mail"); var smptServerNode = mailNode.SelectSingleNode("smtp-server"); var credentialsNode = mailNode.SelectSingleNode("credentials"); var senderNode = mailNode.SelectSingleNode("sender"); this.Mail = new Configuration.MailConfiguration { ServerAddress = smptServerNode.Attributes["addr"].InnerText, ServerPort = Convert.ToInt32(smptServerNode.Attributes["port"].InnerText), Username = credentialsNode.Attributes["username"].InnerText, Password = credentialsNode.Attributes["password"].InnerText, Address = senderNode.Attributes["addr"].InnerText, }; } { section = "rest-api-server/news"; var newsNode = doc.SelectSingleNode("configuration/rest-api-server/news"); if (newsNode != null) { this.Announcements = new List <Announcement>(); foreach (var nodeElement in newsNode.ChildNodes) { var node = nodeElement as XmlNode; this.Announcements.Add(new Announcement { Title = node.Attributes["title"].InnerText, Text = node.InnerXml.Trim(), ImageURL = node.Attributes["image"] != null ? node.Attributes["image"].InnerText : "", LinkURL = node.Attributes["url"] != null ? node.Attributes["url"].InnerText : "" }); } } } { section = "rest-api-server/sign-up"; var node = doc.SelectSingleNode("configuration/rest-api-server/sign-up"); this.SignUpEnabled = node.Attributes["enabled"].InnerText.Equals("true"); } { section = "rest-api-server/statics-redirection"; var redirectionNode = doc.SelectSingleNode("configuration/rest-api-server/statics-redirection"); var ip = this.parseAddress(redirectionNode.Attributes["ip"].InnerText); var port = Convert.ToUInt32(redirectionNode.Attributes["port"].InnerText); this.StaticsRedirection = new RedirectionConfiguration { Enabled = redirectionNode.Attributes["enabled"].InnerText.Equals("true"), Host = String.Format("http://{0}:{1}", ip, port) }; } { section = "rest-api-server/recaptcha"; var recaptchaNode = doc.SelectSingleNode("configuration/rest-api-server/recaptcha"); this.Recaptcha = new RecaptchaConfiguration { Enabled = recaptchaNode.Attributes["enabled"].InnerText.Equals("true"), VisibleSecret = recaptchaNode.Attributes["visible-secret"].InnerText, InvisibleSecret = recaptchaNode.Attributes["invisible-secret"].InnerText }; } } { section = "login-server/addr"; var loginAddressNode = doc.SelectSingleNode("configuration/login-server/addr"); this.LoginServerAddress = this.parseAddress(loginAddressNode.Attributes["ip"].InnerText); this.LoginServerPort = Convert.ToInt32(loginAddressNode.Attributes["port"].InnerText); } section = "locale"; var overrideLocaleNode = doc.SelectSingleNode("configuration/locale"); if (overrideLocaleNode != null) { this.OverrideLocale = overrideLocaleNode.Attributes["override-to"].InnerText; } section = "token"; var tokenSaltNode = doc.SelectSingleNode("configuration/token"); this.TokenSalt = tokenSaltNode.Attributes["salt"].InnerText; section = "banned-addresses"; var bannedAddresses = doc.SelectSingleNode("configuration/banned-addresses"); if (bannedAddresses != null) { this.BannedAddresses = new List <string>(); foreach (var nodeElement in bannedAddresses.ChildNodes) { var node = nodeElement as XmlNode; this.BannedAddresses.Add(node.Attributes["ip"].InnerText); } } } catch (Exception e) { Log.Error("LoadConfiguration caught exception during loading of section {section}", section); throw new LoadException(section, e); } }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <DBEntities>(options => options.UseMySql(ConnectionString, b => b.MigrationsAssembly("WebApi"))); services.AddIdentity <User, IdentityRole>(config => { }).AddEntityFrameworkStores <DBEntities>() .AddDefaultTokenProviders(); services.ConfigureApplicationCookie(options => { options.Events.OnRedirectToLogin = context => { context.Response.StatusCode = 401; return(Task.CompletedTask); }; }); CurrencyConfiguration currencyConfiguration = Configuration.GetSection("CurrencyConfiguration").Get <CurrencyConfiguration>(); services.AddSingleton(currencyConfiguration); foreach (CurrencyConfigurationItem item in currencyConfiguration.Supported) { string CC = item.CurrencyCode.ToUpper(); Type T = Type.GetType($"WebApi.Adapters.{CC}Adapter"); currencyConfiguration.Adapters.Add(CC, (ICurrencyAdapter)Activator.CreateInstance(T)); } ////add fb +ggl oath ////FB //services.AddAuthentication(options=> { // options.DefaultChallengeScheme = FacebookDefaults.AuthenticationScheme; // options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; // options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; //}).AddFacebook(options => //{ // options.AppId = ""; // options.AppSecret = ""; //}).AddCookie(); ////GGL //services.AddAuthentication(options => { // options.DefaultChallengeScheme = GoogleDefaults.AuthenticationScheme; // options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; // options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; //}).AddGoogle(options => //{ // options.ClientId = ""; // options.ClientSecret = ""; //}).AddCookie(); services.AddCors(o => o.AddPolicy("CorsPolicy", builder => { builder.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials(); })); services.AddTransient <IEmailSender, EmailSender>(); services.AddMvc(); }
protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.ApplyConfiguration(new CategoryConfiguration()); modelBuilder.Entity <Category>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new WarehouseConfiguration()); modelBuilder.Entity <Warehouse>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new SupplierConfiguration()); modelBuilder.Entity <Supplier>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new BankAccountConfiguration()); modelBuilder.Entity <BankAccount>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new BankAccountTypeConfiguration()); modelBuilder.Entity <BankAccountType>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new UserConfiguration()); modelBuilder.ApplyConfiguration(new CompanyConfiguration()); modelBuilder.ApplyConfiguration(new UserClientConfiguration()); modelBuilder.Entity <Client>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new PaymentTermConfiguration()); modelBuilder.Entity <PaymentTerm>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new ProductConfiguration()); modelBuilder.Entity <Product>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new TaxConfiguration()); modelBuilder.Entity <Tax>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new UnitOfMeasureConfiguration()); modelBuilder.Entity <UnitOfMeasure>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new TaxRegimeTypeConfiguration()); modelBuilder.Entity <TaxRegimeType>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new DocumentNumberSequenceConfiguration()); modelBuilder.Entity <DocumentNumberSequence>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new InvoiceHeaderConfiguration()); modelBuilder.Entity <InvoiceHeader>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new InvoiceDetailConfiguration()); modelBuilder.Entity <InvoiceDetail>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new PaymentMethodConfiguration()); modelBuilder.Entity <PaymentMethod>() .HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new PurchaseOrderHeaderConfiguration()); modelBuilder.Entity <PurchaseOrderHeader>().HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new PurchaseOrderDetailConfiguration()); modelBuilder.Entity <PurchaseOrderDetail>().HasQueryFilter(c => c.CompanyId == _companyId && c.Status == EntityStatus.Active); modelBuilder.ApplyConfiguration(new CountryConfiguration()); modelBuilder.Entity <Country>().HasData(CountryConfiguration.InitialCountryData()); modelBuilder.ApplyConfiguration(new GoodsTypeConfiguration()); modelBuilder.Entity <GoodsType>().HasData(GoodsTypeConfiguration.InitialGoodsTypeData()); modelBuilder.ApplyConfiguration(new CurrencyConfiguration()); modelBuilder.Entity <Currency>().HasData(CurrencyConfiguration.InitialCurrencyData()); modelBuilder.ApplyConfiguration(new RoleConfiguration()); base.OnModelCreating(modelBuilder); }