Exemplo n.º 1
0
        async public Task <IExplorerFileObject> CreateInstance(IExplorerObject parent, string filename)
        {
            string f = filename.ToLower();

            if (!f.ToLower().EndsWith(".fdb"))
            {
                return(null);
            }

            try
            {
                if (!(new FileInfo(f).Exists))
                {
                    return(null);
                }

                using (SQLiteFDB fdb = new SQLiteFDB())
                {
                    if (!await fdb.Open(f) || !await fdb.IsValidAccessFDB())
                    {
                        return(null);
                    }
                }
            }
            catch { return(null); }

            return(new SQLiteFDBExplorerObject(parent, filename));
        }