public BewitFactory(ICryptoHelpers cryptoHelpers, ITextHelpers textHelpers) { Ensure.Argument.IsNotNull(cryptoHelpers, nameof(cryptoHelpers)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); this.cryptoHelpers = cryptoHelpers; this.textHelpers = textHelpers; }
protected BaseContractResolver(ITextHelpers textHelpers, Type toIncludeAttributeType) { Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(toIncludeAttributeType, nameof(toIncludeAttributeType)); this.textHelpers = textHelpers; this.toIncludeAttributeType = toIncludeAttributeType; this.modelType = typeof(ModelBase); }
public TentHawkSignatureFactory(ICryptoHelpers cryptoHelpers, ITextHelpers textHelpers, IUriHelpers uriHelpers) { Ensure.Argument.IsNotNull(cryptoHelpers, "cryptoHelpers"); Ensure.Argument.IsNotNull(textHelpers, "textHelpers"); Ensure.Argument.IsNotNull(uriHelpers, "uriHelpers"); this.cryptoHelpers = cryptoHelpers; this.textHelpers = textHelpers; this.uriHelpers = uriHelpers; }
public TentHawkSignature(ICryptoHelpers cryptoHelpers, ITextHelpers textHelpers, IUriHelpers uriHelpers) { Ensure.Argument.IsNotNull(cryptoHelpers, nameof(cryptoHelpers)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(uriHelpers, nameof(uriHelpers)); this.cryptoHelpers = cryptoHelpers; this.textHelpers = textHelpers; this.uriHelpers = uriHelpers; }
public AttachmentLoader( ITables tables, ITextHelpers textHelpers, IResourceCacheService resourceCacheService) { Ensure.Argument.IsNotNull(tables, nameof(tables)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(resourceCacheService, nameof(resourceCacheService)); this.textHelpers = textHelpers; this.resourceCacheService = resourceCacheService; this.attachmentsTable = tables.TableForType <CacheAttachment>(); }
public HawkSignature( ICryptoHelpers cryptoHelpers, ITextHelpers textHelpers, IUriHelpers uriHelpers) { Ensure.Argument.IsNotNull(cryptoHelpers, nameof(cryptoHelpers)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(uriHelpers, nameof(uriHelpers)); this.cryptoHelpers = cryptoHelpers; this.textHelpers = textHelpers; this.uriHelpers = uriHelpers; }
public InternalUserLoader( ITables tables, ITextHelpers textHelpers, IResourceCacheService resourceCacheService) { Ensure.Argument.IsNotNull(tables, nameof(tables)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(resourceCacheService, nameof(resourceCacheService)); this.textHelpers = textHelpers; this.resourceCacheService = resourceCacheService; this.userTable = tables.TableForVersionedType <CacheUser>(); }
public HawkSignatureFactory( ICryptoHelpers cryptoHelpers, ITextHelpers textHelpers, IUriHelpers uriHelpers) { Ensure.Argument.IsNotNull(cryptoHelpers, nameof(cryptoHelpers)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(uriHelpers, nameof(uriHelpers)); this.cryptoHelpers = cryptoHelpers; this.textHelpers = textHelpers; this.uriHelpers = uriHelpers; this.authorizationHeaderRegex = new Regex("(id|ts|nonce|mac|ext|hash|app)=\"([^\"\\\\]*)\""); }
public AwsQueue(IJsonHelpers jsonHelpers, ITextHelpers textHelpers, AmazonSQSClient client, string queueUrl) { Ensure.Argument.IsNotNull(jsonHelpers, nameof(jsonHelpers)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(client, nameof(client)); Ensure.Argument.IsNotNullOrWhiteSpace(queueUrl, nameof(queueUrl)); this.jsonHelpers = jsonHelpers; this.textHelpers = textHelpers; this.client = client; this.queueUrl = queueUrl; }
public MongoTables( ILoggingService loggingService, ITextHelpers textHelpers, IConfiguration configuration) { Ensure.Argument.IsNotNull(loggingService, nameof(loggingService)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(configuration, nameof(configuration)); this.configuration = configuration; // Configure the Mongo connection. var clientSettings = new MongoClientSettings { Servers = configuration.MongoServers.Select(kv => new MongoServerAddress(kv.Key, kv.Value)), ApplicationName = "MainApp", //WriteConcern = WriteConcern.WMajority, //ReadConcern = ReadConcern.Majority, ReadPreference = ReadPreference.Nearest, GuidRepresentation = GuidRepresentation.Standard }; // If needed, set up logging. if (configuration.MongoDebug) { clientSettings.ClusterConfigurator = cluster => { cluster.Subscribe <CommandStartedEvent>(e => loggingService.Info("[Mongo] {0} Started - {1}", e.CommandName, e.Command.ToJson())); cluster.Subscribe <CommandSucceededEvent>(e => loggingService.Info("[Mongo] {0} Succeeded - {1}", e.CommandName, e.Reply.ToJson())); cluster.Subscribe <CommandFailedEvent>(e => loggingService.Exception(e.Failure, "[Mongo] {0} Failed", e.CommandName)); } } ; // Configure serialization. var conventionPack = new ConventionPack(); conventionPack.Add(new SnakeCaseElementNameConvention(textHelpers)); ConventionRegistry.Register("snakeCase", conventionPack, t => true); // Create the client and get a reference to the Db. var client = new MongoClient(clientSettings); this.database = client.GetDatabase(configuration.MongoDatabaseName); // Create the initializer for this component. this.initializer = new TaskRunner(this.InitializeOnceAsync); }
public ResourceCacheService( ITables tables, ICaches caches, ITextHelpers textHelpers) { Ensure.Argument.IsNotNull(tables, nameof(tables)); Ensure.Argument.IsNotNull(caches, nameof(caches)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); this.tables = tables; this.caches = caches; this.textHelpers = textHelpers; // Create our collections. this.resources = new Dictionary <string, object>(); this.resourceLocks = new Dictionary <string, AsyncLock>(); }
public JsMainBinding(ITaskBarOverlayService taskBarOverlayService, INotificationsService notificationsService, IViewModelFactory viewModelFactory, IDispatcherService dispatcherService, ITextHelpers textHelpers) { Ensure.Argument.IsNotNull(taskBarOverlayService, nameof(taskBarOverlayService)); Ensure.Argument.IsNotNull(notificationsService, nameof(notificationsService)); Ensure.Argument.IsNotNull(viewModelFactory, nameof(viewModelFactory)); Ensure.Argument.IsNotNull(dispatcherService, nameof(dispatcherService)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); this.taskBarOverlayService = taskBarOverlayService; this.notificationsService = notificationsService; this.viewModelFactory = viewModelFactory; this.dispatcherService = dispatcherService; this.textHelpers = textHelpers; }
public JsBridgeService(IViewModelFactory viewModelFactory, IJsBindingFactory jsBindingFactory, IWindowService windowService, ITextHelpers textHelpers, IAppConstants appConstants) { Ensure.Argument.IsNotNull(viewModelFactory, "viewModelFactory"); Ensure.Argument.IsNotNull(jsBindingFactory, "jsBindingFactory"); Ensure.Argument.IsNotNull(windowService, "windowService"); Ensure.Argument.IsNotNull(textHelpers, "textHelpers"); Ensure.Argument.IsNotNull(appConstants, "appConstants"); this.viewModelFactory = viewModelFactory; this.jsBindingFactory = jsBindingFactory; this.windowService = windowService; this.textHelpers = textHelpers; this.appConstants = appConstants; }
public ExternalUserLoader( IConstants constants, ITextHelpers textHelpers, IHttp http, IProtocol protocol, IResourceCacheService resourceCacheService) { Ensure.Argument.IsNotNull(constants, nameof(constants)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(http, nameof(http)); Ensure.Argument.IsNotNull(protocol, nameof(protocol)); Ensure.Argument.IsNotNull(resourceCacheService, nameof(resourceCacheService)); this.constants = constants; this.textHelpers = textHelpers; this.http = http; this.protocol = protocol; this.resourceCacheService = resourceCacheService; }
public JsonHelpers( ILoggingService loggingService, ITextHelpers textHelpers, IConfiguration configuration) { Ensure.Argument.IsNotNull(loggingService, nameof(loggingService)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(configuration, nameof(configuration)); this.configuration = configuration; this.loggingService = loggingService; this.defaultFormatting = Formatting.None; this.defaultSettings = new JsonSerializerSettings { TraceWriter = this, ContractResolver = new BaseContractResolver(textHelpers) }; }
public static User FromMetaPost( ITextHelpers textHelpers, IResourceCacheService resourceCacheService, ApiPost <MetaPostContent> metaPost) { Ensure.Argument.IsNotNull(metaPost, nameof(metaPost)); var dateNow = DateTime.UtcNow; var metaContent = metaPost.Content; return(new User(resourceCacheService) { Id = textHelpers.GenerateUniqueId(), CreatedAt = dateNow, OriginalCreatedAt = dateNow, Entity = metaContent.Entity }); }
public InternalPostLoader( ITables tables, IPostLicenseLoader postLicenseLoader, ITextHelpers textHelpers, IResourceCacheService resourceCacheService, IInternalUserLoader internalUserLoader, IAttachmentLoader attachmentLoader) { Ensure.Argument.IsNotNull(tables, nameof(tables)); Ensure.Argument.IsNotNull(postLicenseLoader, nameof(postLicenseLoader)); Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); Ensure.Argument.IsNotNull(resourceCacheService, nameof(resourceCacheService)); Ensure.Argument.IsNotNull(internalUserLoader, nameof(internalUserLoader)); Ensure.Argument.IsNotNull(attachmentLoader, nameof(attachmentLoader)); this.textHelpers = textHelpers; this.resourceCacheService = resourceCacheService; this.internalUserLoader = internalUserLoader; this.attachmentLoader = attachmentLoader; this.postLicenseLoader = postLicenseLoader; this.postTable = tables.TableForVersionedType <CachePost>(); }
public DbContractResolver(ITextHelpers textHelpers) : base(textHelpers, typeof(DbPropertyAttribute)) { }
public UserFactory(ITextHelpers textHelpers) { Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); this.textHelpers = textHelpers; }
public SnakeCaseElementNameConvention(ITextHelpers textHelpers) { Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); this.textHelpers = textHelpers; }
public BaseContractResolver(ITextHelpers textHelpers) { Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers)); this.textHelpers = textHelpers; }