TryParse() public static method

public static TryParse ( string source, AzureStoreConfiguration &configuration ) : bool
source string
configuration AzureStoreConfiguration
return bool
        /// <summary>
        /// Creates a connection to event store, which can both read and write events.
        /// </summary>
        /// <param name="storageConfiguration">Storage configuration (either local file path
        ///     or <see cref="AzureStoreConfiguration"/>).</param>
        /// <param name="storeId">Id of the store to connect to</param>
        /// <param name="platformServerEndpoint">URL of public server API.</param>
        /// <returns>new instance of the client that can read and write events.</returns>
        public static IRawEventStoreClient ConnectToEventStore(string storageConfiguration, string storeId, string platformServerEndpoint)
        {
            var container = EventStoreId.Parse(storeId);

            AzureStoreConfiguration configuration;

            if (!AzureStoreConfiguration.TryParse(storageConfiguration, out configuration))
            {
                return(new FileEventStoreClient(storageConfiguration, container, platformServerEndpoint));
            }
            return(new AzureEventStoreClient(configuration, container, platformServerEndpoint));
        }
        /// <summary>
        /// Creates a connection to event store, which can only both read and write events.
        /// Platform API connection is not needed.
        /// </summary>
        /// <param name="storageConfiguration">Storage configuration (either local file path
        /// or <see cref="AzureStoreConfiguration"/>)</param>
        /// <param name="storeId">Id of the store to connect to</param>
        /// <returns>new instance of the client that can read events</returns>
        public static IRawEventStoreClient ConnectToEventStoreAsReadOnly(
            string storageConfiguration,
            string storeId)
        {
            var container = EventStoreId.Parse(storeId);
            AzureStoreConfiguration configuration;

            if (!AzureStoreConfiguration.TryParse(storageConfiguration, out configuration))
            {
                return(new FileEventStoreClient(storageConfiguration, container));
            }
            return(new AzureEventStoreClient(configuration, container));
        }
        /// <summary>
        /// Creates a connection to view storage
        /// </summary>
        /// <param name="storageConfiguration">Storage configuration (either local file path
        /// or <see cref="AzureStoreConfiguration"/>)</param>
        /// <param name="containerName">container name (directory) where to put views</param>
        /// <returns>new instance of the client that can read and write events</returns>
        public static ViewClient ConnectToViewStorage(string storageConfiguration, string containerName)
        {
            AzureStoreConfiguration configuration;

            if (!AzureStoreConfiguration.TryParse(storageConfiguration, out configuration))
            {
                var root = new FileViewRoot(new DirectoryInfo(storageConfiguration));

                var viewClient = new ViewClient(root.GetContainer(containerName), FileActionPolicy);
                viewClient.CreateContainerIfNeeded();
                return(viewClient);
            }
            else
            {
                var account       = CloudStorageAccount.Parse(configuration.ConnectionString);
                var client        = account.CreateCloudBlobClient();
                var viewContainer = new AzureViewRoot(client).GetContainer(configuration.RootBlobContainerName);

                var viewClient = new ViewClient(viewContainer.GetContainer(containerName), AzureActionPolicy);
                viewClient.CreateContainerIfNeeded();
                return(viewClient);
            }
        }