public void CreateDatafile() { using (var s = new FileStream(Filename, System.IO.FileMode.CreateNew)) { LiteEngine.CreateDatabase(s); } }
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); }
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); }