private DLoggerManager(String appName, Boolean forceDummy) { if (ForceAllToDummy || forceDummy) { _defaultLogger = new DummyDLogger(); } else { if (DLoggerConfig.LoadDefault(appName, out _config)) { InitialiseDefaultLogger(); if (_config.DefaultEnabled) { _defaultLogger = new DLogger(_config); } else { _defaultLogger = new DummyDLogger(); } } else { _defaultLogger = new DummyDLogger(); } } }
public static void Initialise( IDLogger logger, Func <ClipboardObfuscatorGeneratedFakeEventArgs, Task> action) { _instance = CreateDefault( logger, action); }
public static CloudStorageProviderBase CreateOAuth <T>(IDLogger logger, string accessToken) where T : CloudStorageProviderBase { DLoggerManager.Instance.Logger.Log(LoggerMessageType.VerboseLow | LoggerMessageType.Information, "Creating CloudStorageProviderBase instance of type '{0}'.", typeof(T).Name); T instance = (T)Activator.CreateInstance(typeof(T), logger, accessToken); return(instance); }
public AmazonS3StorageProvider(IDLogger logger, AmazonS3Config config) : base(logger) { _config = config; RegionEndpoint regionEndpoint = AmazonS3Regions.GetRegionByDisplayName(config.Region); _s3Client = new AmazonS3Client( config.AccessID, config.SecretKey, regionEndpoint); }
private ClipboardObfuscator( IDLogger logger, bool fakeUsernames, bool fakePasswords, Func <ClipboardObfuscatorGeneratedFakeEventArgs, Task> action) { _logger = logger; _fakeUsernames = fakeUsernames; _fakePassword = fakePasswords; _action = action; }
public static void Initialise(IDLogger logger, Func <string, string, object> getProviderValueCallback, Func <string, string> getCredentialCallback) { DLoggerManager.Instance.Logger.Log(LoggerMessageType.VerboseLow | LoggerMessageType.Information, "Initialising static instance of CloudStorageSyncManager."); _instance = new CloudStorageSyncManager( logger, getProviderValueCallback, getCredentialCallback); }
public CloudStorageSyncManager(IDLogger logger, Func <string, string, object> getProviderValueCallback, Func <string, string> getCredentialCallback) { DLoggerManager.Instance.Logger.Log(LoggerMessageType.VerboseLow | LoggerMessageType.Information, "Creating instance of CloudStorageSyncManager."); _logger = logger; _getProviderValueCallback = getProviderValueCallback; _getCredentialCallback = getCredentialCallback; _providers = new Dictionary <VaultIndex, CloudStorageProviderBase>(); }
public void InitialiseDefaultLogger() { if (_config.DefaultEnabled) { _defaultLogger = new DLogger(_config); } else { _defaultLogger = new DummyDLogger(); } }
private static ClipboardObfuscator CreateDefault( IDLogger logger, Func <ClipboardObfuscatorGeneratedFakeEventArgs, Task> action) { ClipboardObfuscator instance = new ClipboardObfuscator( logger, true, true, action); return(instance); }
public static CloudStorageProviderBase Create( IDLogger logger, VaultIndex vaultIndex, Dictionary <string, string> parameters) { if (vaultIndex.SyncMode == Common.SyncMode.CloudProvider) { string providerKey = parameters["ProviderKey"]; switch (providerKey) { case "Dropbox": { string accessToken = parameters["AccessToken"]; return(CreateOAuth <DropboxStorageProvider>( logger, accessToken)); } case "OneDrive": { string accessToken = parameters["AccessToken"]; return(CreateOAuth <OneDriveStorageProvider>( logger, accessToken)); } case "AmazonS3": { string accessID = parameters["AccessID"]; string secretKey = parameters["SecretKey"]; string region = parameters["Region"]; string bucketName = parameters["BucketName"]; string path = parameters["Path"]; return(CreateAmazon <AmazonS3StorageProvider>( logger, accessID, secretKey, region, bucketName, path)); } default: { throw new NotSupportedException(String.Format("Sync OAuth provider of type '{0}' not supported.", providerKey)); } } } else { return(null); } }
public static CloudStorageProviderBase CreateAmazon <T>(IDLogger logger, string accessID, string secretKey, string region, string bucketName, string path) where T : CloudStorageProviderBase { DLoggerManager.Instance.Logger.Log(LoggerMessageType.VerboseLow | LoggerMessageType.Information, "Creating CloudStorageProviderBase instance of type '{0}'.", typeof(T).Name); AmazonS3Config config = new AmazonS3Config( accessID, secretKey, region, bucketName, path); T instance = (T)Activator.CreateInstance(typeof(T), logger, config); return(instance); }
public OneDriveStorageProvider(IDLogger logger, string accessToken) : base(logger) { _accessToken = accessToken; _client = new HttpClient(); }
protected CloudStorageProviderBase(IDLogger logger) { _logger = logger; }
public DropboxStorageProvider(IDLogger logger, string accessToken) : base(logger) { _client = new DropboxClient(accessToken, new DropboxClientConfig()); }