private void AutomaticUpsert() { var window_directory = new Window_SelectDirectory("Select Directory", null); window_directory.ShowDialog(); if (window_directory.Accepted) { var window_relativeUri = new Window_TextEntry("Relative URI", @"images\"); window_relativeUri.ShowDialog(); if (window_relativeUri.Accepted) { GinTubBuilderManager.UpsertLocationAutomatically(window_directory.DirectoryName, window_relativeUri.Text); } } }
private void SetUriHelper(ref string helper, string typeOfUriHelper) { while (string.IsNullOrWhiteSpace(helper)) { var window_imageUrl = new Window_TextEntry("Image " + typeOfUriHelper, ""); window_imageUrl.ShowDialog(); if (window_imageUrl.Accepted) { helper = window_imageUrl.Text; } } }
private void NewLocationDialog() { bool accepted = !string.IsNullOrWhiteSpace(s_relativeUrl); while (!accepted) { var window_relativeUrl = new Window_TextEntry("Image Relative Url", ""); window_relativeUrl.ShowDialog(); if (window_relativeUrl.Accepted) { accepted = true; s_relativeUrl = window_relativeUrl.Text; } } if (accepted) { Window_OpenFile window_openFile = new Window_OpenFile("Location File", string.Empty); window_openFile.Closed += (x, y) => { if (window_openFile.Accepted) { Window_TextEntry window_textEntry = new Window_TextEntry("Location Name", Path.GetFileNameWithoutExtension(window_openFile.FileName)); window_textEntry.Closed += (a, b) => { if (window_textEntry.Accepted) GinTubBuilderManager.CreateLocation(window_textEntry.Text, Path.Combine(s_relativeUrl, Path.GetFileName(window_openFile.FileName))); }; window_textEntry.Show(); } }; window_openFile.Show(); } }