TileCook.MBTilesCache.InitializeFormat C# (CSharp) Method

InitializeFormat() private method

private InitializeFormat ( string Format ) : string
Format string
return string
        private string InitializeFormat(string Format)
        {
            //get internal Format of MBTiles Database
            string internal_Format = GetInternalFormat();

            //begin logic for determining mbtiles Format
            if (Format == null && internal_Format == null)
            {
                string error = "Could not determine MBTiles Format.";
                if (this._version == "1.0.0")
                {
                    error = error + " Cannot determine Format of empty v1.0.0 Database.";
                }
                error = error + " Try explicitly configuring MBTiles cache Format.";
                throw new InvalidOperationException(error);
            }
            else if (Format == null && internal_Format != null)
            {
                return internal_Format;
            }
            else if (Format != null && internal_Format == null)
            {
                return Format;
            }
            else
            {
                if (!Format.Equals(internal_Format, StringComparison.OrdinalIgnoreCase))
                {
                    throw new ArgumentException(string.Format("Format {0} does not match internal MBTiles Format {1}", Format, internal_Format));
                }
                return Format;
            }
        }