Exemplo n.º 1
0
        public override Dictionary <string, object> ParseConnectionString(string connectionString)
        {
            var items = new Dictionary <string, object>();

            items["Type"] = "Layered";

            var json        = JsonObject.Parse(connectionString) as JsonObject;
            var connections = new List <IStorageConnection>();

            if (json.ContainsKey("Layers"))
            {
                foreach (JsonObject connectionJson in json.GetJsonArray("Layers"))
                {
                    var layeredConnectionString = connectionJson.ToString();
                    var factory    = StorageProviderFactories.GetFactoryByConnectionString(layeredConnectionString);
                    var connection = factory.CreateConnection(layeredConnectionString);
                    connections.Add(connection);
                }
            }
            items["Layers"] = new StorageConnectionCollection(connections.ToArray());

            return(items);
        }
 public AzureBlobStorageConnection(AzureBlobStorageProviderFactory factory)
 {
     _factory = (factory ?? StorageProviderFactories.GetFactoryByProviderName("AzureBlob")) as AzureBlobStorageProviderFactory;
 }
Exemplo n.º 3
0
 public LayeredStorageConnection(IStorageProviderFactory factory)
 {
     _factory = (factory ?? StorageProviderFactories.GetFactoryByProviderName("Layered")) as LayeredStorageProviderFactory;
 }
 public LocalFileStorageConnection(IStorageProviderFactory factory)
 {
     _factory = (factory ?? StorageProviderFactories.GetFactoryByProviderName("LocalFile")) as LocalFileStorageProviderFactory;
 }