Example #1
0
 public void CreateDatafile()
 {
     using (var s = new FileStream(Filename, System.IO.FileMode.CreateNew))
     {
         LiteEngine.CreateDatabase(s);
     }
 }
Example #2
0
        public bool HandleCreateDatabase(NSUrl url)
        {
            var path = url.Path;

            using (var stream = new FileStream(path, System.IO.FileMode.Create))
            {
                LiteEngine.CreateDatabase(stream);
            }

            HandleOpenDatabase(url);

            return(true);
        }
Example #3
0
        public async Task CreateAndOpenDatabase()
        {
            var maybeFileName = await _applicationInteraction.ShowSaveFileDialog("New Database");

            if (maybeFileName.HasNoValue)
            {
                return;
            }

            using (var stream = new FileStream(maybeFileName.Value, System.IO.FileMode.Create))
            {
                LiteEngine.CreateDatabase(stream);
            }

            await OpenDatabase(maybeFileName.Value).ConfigureAwait(false);
        }
        private void NewCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var dialog = new SaveFileDialog()
            {
                Filter          = "All files|*.*",
                OverwritePrompt = true
            };

            if (dialog.ShowDialog() != true)
            {
                return;
            }

            using (var stream = new FileStream(dialog.FileName, System.IO.FileMode.Create))
            {
                LiteEngine.CreateDatabase(stream);
            }

            OpenDatabase(dialog.FileName);
        }
        public async Task CreateAndOpenDatabase()
        {
            var dialog = new SaveFileDialog
            {
                Filter          = "All files|*.*",
                OverwritePrompt = true
            };

            if (dialog.ShowDialog() != true)
            {
                return;
            }

            using (var stream = new FileStream(dialog.FileName, System.IO.FileMode.Create))
            {
                LiteEngine.CreateDatabase(stream);
            }

            await OpenDatabase(dialog.FileName).ConfigureAwait(false);
        }