Added UNSAFE_MigrationHelper to help with upgrades

This commit is contained in:
Robert McRackan 2021-07-16 23:06:59 -04:00
parent f94f66da94
commit 71617b9620
8 changed files with 467 additions and 313 deletions

View File

@ -32,9 +32,6 @@ namespace FileManager
public static string DecryptInProgress => Directory.CreateDirectory(Path.Combine(Configuration.Instance.DecryptInProgressEnum, "DecryptInProgress")).FullName; public static string DecryptInProgress => Directory.CreateDirectory(Path.Combine(Configuration.Instance.DecryptInProgressEnum, "DecryptInProgress")).FullName;
// not customizable. don't move to config
public static string DownloadsFinal => new DirectoryInfo(Configuration.Instance.LibationFiles).CreateSubdirectory("DownloadsFinal").FullName;
public static string BooksDirectory public static string BooksDirectory
{ {
get get

View File

@ -56,7 +56,7 @@ namespace FileManager
public const string USER_PROFILE_LABEL = "UserProfile"; public const string USER_PROFILE_LABEL = "UserProfile";
public static string AppDir_Relative => @".\LibationFiles"; public static string AppDir_Relative => @".\LibationFiles";
public static string AppDir_Absolute => Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Exe.FileLocationOnDisk), LIBATION_FILES)); public static string AppDir_Absolute => Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Exe.FileLocationOnDisk), LIBATION_FILES_KEY));
public static string MyDocs => Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "LibationFiles")); public static string MyDocs => Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "LibationFiles"));
public static string WinTemp => Path.GetFullPath(Path.Combine(Path.GetTempPath(), "Libation")); public static string WinTemp => Path.GetFullPath(Path.Combine(Path.GetTempPath(), "Libation"));
public static string UserProfile => Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Libation")); public static string UserProfile => Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Libation"));
@ -112,6 +112,13 @@ namespace FileManager
// exceptions: appsettings.json, LibationFiles dir, Settings.json // exceptions: appsettings.json, LibationFiles dir, Settings.json
// temp/working dir(s) should be outside of dropbox // temp/working dir(s) should be outside of dropbox
[Description("Temporary location of files while they're in process of being downloaded and decrypted.\r\nWhen decryption is complete, the final file will be in Books location\r\nRecommend not using a folder which is backed up real time. Eg: Dropbox, iCloud, Google Drive")]
public string InProgress
{
get => persistentDictionary.GetString(nameof(InProgress));
set => persistentDictionary.Set(nameof(InProgress), value);
}
[Description("Temporary location of files while they're in process of being downloaded.\r\nWhen download is complete, the final file will be in [LibationFiles]\\DownloadsFinal")] [Description("Temporary location of files while they're in process of being downloaded.\r\nWhen download is complete, the final file will be in [LibationFiles]\\DownloadsFinal")]
public string DownloadsInProgressEnum public string DownloadsInProgressEnum
{ {
@ -140,8 +147,8 @@ namespace FileManager
private Configuration() { } private Configuration() { }
private const string APPSETTINGS_JSON = "appsettings.json"; private const string APPSETTINGS_JSON = "appsettings.json";
// this is the key in appsettings. Happens to match the metadirectory name but separate concern. keep separate // this is the key in appsettings. The string happens to match the metadirectory name but separate concern. keep separate
private const string LIBATION_FILES = "LibationFiles"; private const string LIBATION_FILES_KEY = "LibationFiles";
[Description("Location for storage of program-created files")] [Description("Location for storage of program-created files")]
public string LibationFiles public string LibationFiles
@ -173,11 +180,9 @@ namespace FileManager
startingContents = File.ReadAllText(APPSETTINGS_JSON); startingContents = File.ReadAllText(APPSETTINGS_JSON);
var startingJObj = JObject.Parse(startingContents); var startingJObj = JObject.Parse(startingContents);
if (startingJObj.ContainsKey(LIBATION_FILES)) if (startingJObj.ContainsKey(LIBATION_FILES_KEY))
{ {
var startingValue = startingJObj[LIBATION_FILES].Value<string>(); var startingValue = startingJObj[LIBATION_FILES_KEY].Value<string>();
// do not check whether directory exists. special/meta directory (eg: AppDir) is valid
if (!string.IsNullOrWhiteSpace(startingValue)) if (!string.IsNullOrWhiteSpace(startingValue))
return startingValue; return startingValue;
} }
@ -186,7 +191,7 @@ namespace FileManager
catch { } catch { }
// not found. write to file. read from file // not found. write to file. read from file
var endingContents = new JObject { { LIBATION_FILES, UserProfile } }.ToString(Formatting.Indented); var endingContents = new JObject { { LIBATION_FILES_KEY, UserProfile } }.ToString(Formatting.Indented);
if (startingContents != endingContents) if (startingContents != endingContents)
{ {
File.WriteAllText(APPSETTINGS_JSON, endingContents); File.WriteAllText(APPSETTINGS_JSON, endingContents);
@ -196,7 +201,7 @@ namespace FileManager
// do not check whether directory exists. special/meta directory (eg: AppDir) is valid // do not check whether directory exists. special/meta directory (eg: AppDir) is valid
// verify from live file. no try/catch. want failures to be visible // verify from live file. no try/catch. want failures to be visible
var jObjFinal = JObject.Parse(File.ReadAllText(APPSETTINGS_JSON)); var jObjFinal = JObject.Parse(File.ReadAllText(APPSETTINGS_JSON));
var valueFinal = jObjFinal[LIBATION_FILES].Value<string>(); var valueFinal = jObjFinal[LIBATION_FILES_KEY].Value<string>();
return valueFinal; return valueFinal;
} }
@ -235,7 +240,7 @@ namespace FileManager
var startingContents = File.ReadAllText(APPSETTINGS_JSON); var startingContents = File.ReadAllText(APPSETTINGS_JSON);
var jObj = JObject.Parse(startingContents); var jObj = JObject.Parse(startingContents);
jObj[LIBATION_FILES] = directory; jObj[LIBATION_FILES_KEY] = directory;
var endingContents = JsonConvert.SerializeObject(jObj, Formatting.Indented); var endingContents = JsonConvert.SerializeObject(jObj, Formatting.Indented);
if (startingContents != endingContents) if (startingContents != endingContents)

View File

@ -26,13 +26,15 @@ namespace LibationLauncher
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
// must occur before access to Configuration instance
migrate_to_v5_2_0();
createSettings(); createSettings();
AudibleApiStorage.EnsureAccountsSettingsFileExists(); AudibleApiStorage.EnsureAccountsSettingsFileExists();
migrate_to_v4_0_0(); migrate_to_v4_0_0();
migrate_to_v5_0_0(); migrate_to_v5_0_0();
migrate_to_v5_2_0();
ensureSerilogConfig(); ensureSerilogConfig();
configureLogging(); configureLogging();
@ -259,46 +261,32 @@ namespace LibationLauncher
} }
#endregion #endregion
#region migrate to v5.2.0 : get rid of meta-directories #region migrate to v5.2.0 : get rid of meta-directories, combine DownloadsInProgressEnum and DecryptInProgressEnum => InProgress
private static void migrate_to_v5_2_0() private static void migrate_to_v5_2_0()
{ {
var config = Configuration.Instance;
{ {
var newPath = TranslatePath(config.DecryptInProgressEnum); var settingsKey = "DownloadsInProgressEnum";
if (newPath != config.DecryptInProgressEnum) UNSAFE_MigrationHelper.Settings_Update(settingsKey, translatePath(UNSAFE_MigrationHelper.Settings_Get(settingsKey)));
config.DecryptInProgressEnum = newPath;
} }
{ {
var newPath = TranslatePath(config.DownloadsInProgressEnum); var settingsKey = "DecryptInProgressEnum";
if (newPath != config.DownloadsInProgressEnum) UNSAFE_MigrationHelper.Settings_Update(settingsKey, translatePath(UNSAFE_MigrationHelper.Settings_Get(settingsKey)));
config.DownloadsInProgressEnum = newPath;
} }
{ UNSAFE_MigrationHelper.AppSettings_Update(
var appsettings = "appsettings.json"; UNSAFE_MigrationHelper.LIBATION_FILES_KEY,
var libationFiles = "LibationFiles"; translatePath(UNSAFE_MigrationHelper.AppSettings_Get(UNSAFE_MigrationHelper.LIBATION_FILES_KEY))
);
var jObj = JObject.Parse(File.ReadAllText(appsettings));
var origVlaue = jObj[libationFiles].Value<string>();
var newValue = TranslatePath(origVlaue);
if (newValue != origVlaue)
{
var contents = new JObject { { libationFiles, newValue } }.ToString(Formatting.Indented);
File.WriteAllText(appsettings, contents);
}
}
} }
private static string TranslatePath(string path) private static string translatePath(string path)
=> path switch => path switch
{ {
"AppDir" => Configuration.AppDir_Relative, "AppDir" => @".\LibationFiles",
"MyDocs" => Configuration.MyDocs, "MyDocs" => Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "LibationFiles")),
Configuration.USER_PROFILE_LABEL => Configuration.UserProfile, "UserProfile" => Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Libation")),
Configuration.WIN_TEMP_LABEL => Configuration.WinTemp, "WinTemp" => Path.GetFullPath(Path.Combine(Path.GetTempPath(), "Libation")),
_ => path _ => path
}; };
#endregion #endregion
@ -475,9 +463,6 @@ namespace LibationLauncher
DownloadsInProgressDir = AudibleFileStorage.DownloadsInProgress, DownloadsInProgressDir = AudibleFileStorage.DownloadsInProgress,
DownloadsInProgressFiles = Directory.EnumerateFiles(AudibleFileStorage.DownloadsInProgress).Count(), DownloadsInProgressFiles = Directory.EnumerateFiles(AudibleFileStorage.DownloadsInProgress).Count(),
AudibleFileStorage.DownloadsFinal,
DownloadsFinalFiles = Directory.EnumerateFiles(AudibleFileStorage.DownloadsFinal).Count(),
config.DecryptInProgressEnum, config.DecryptInProgressEnum,
DecryptInProgressDir = AudibleFileStorage.DecryptInProgress, DecryptInProgressDir = AudibleFileStorage.DecryptInProgress,
DecryptInProgressFiles = Directory.EnumerateFiles(AudibleFileStorage.DecryptInProgress).Count(), DecryptInProgressFiles = Directory.EnumerateFiles(AudibleFileStorage.DecryptInProgress).Count(),

View File

@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Dinah.Core;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace LibationLauncher
{
/// <summary>for migrations only. directly manipulatings settings files without going through domain logic</summary>
internal static class UNSAFE_MigrationHelper
{
#region appsettings.json
public const string APPSETTINGS_JSON = "appsettings.json";
public static bool AppSettingsJson_Exists => File.Exists(APPSETTINGS_JSON);
public static string AppSettings_Get(string key)
{
bool success = false;
JToken val = null;
process_AppSettingsJson(jObj => success = jObj.TryGetValue(key, out val), false);
if (success)
return val.Value<string>();
return null;
}
/// <summary>only insert if not exists</summary>
public static void AppSettings_Insert(string key, string value)
=> process_AppSettingsJson(jObj => jObj.TryAdd(key, value));
/// <summary>only update if exists</summary>
public static void AppSettings_Update(string key, string value)
=> process_AppSettingsJson(jObj => {
if (jObj.ContainsKey(key))
jObj[key] = value;
});
/// <summary>only delete if exists</summary>
public static void AppSettings_Delete(string key)
=> process_AppSettingsJson(jObj => {
if (jObj.ContainsKey(key))
jObj.Remove(key);
});
/// <param name="save">True: save if contents changed. False: no not attempt save</param>
private static void process_AppSettingsJson(Action<JObject> action, bool save = true)
{
// only insert if not exists
if (!AppSettingsJson_Exists)
return;
var startingContents = File.ReadAllText(APPSETTINGS_JSON);
var jObj = JObject.Parse(startingContents);
action(jObj);
if (!save)
return;
// only save if different
var endingContents_indented = jObj.ToString(Formatting.Indented);
var endingContents_compact = jObj.ToString(Formatting.None);
if (startingContents.EqualsInsensitive(endingContents_indented) || startingContents.EqualsInsensitive(endingContents_compact))
return;
File.WriteAllText(APPSETTINGS_JSON, endingContents_indented);
System.Threading.Thread.Sleep(100);
}
#endregion
#region Settings.json
public const string LIBATION_FILES_KEY = "LibationFiles";
public const string SETTINGS_JSON = "Settings.json";
public static string SettingsJsonPath
{
get
{
var value = AppSettings_Get(LIBATION_FILES_KEY);
return value is null ? null : Path.Combine(value, SETTINGS_JSON);
}
}
public static bool SettingsJson_Exists => SettingsJsonPath is not null && File.Exists(SettingsJsonPath);
public static string Settings_Get(string key)
{
bool success = false;
JToken val = null;
process_SettingsJson(jObj => success = jObj.TryGetValue(key, out val), false);
if (success)
return val.Value<string>();
return null;
}
/// <summary>only insert if not exists</summary>
public static void Settings_Insert(string key, string value)
=> process_SettingsJson(jObj => jObj.TryAdd(key, value));
/// <summary>only update if exists</summary>
public static void Settings_Update(string key, string value)
=> process_SettingsJson(jObj => {
if (jObj.ContainsKey(key))
jObj[key] = value;
});
/// <summary>only delete if exists</summary>
public static void Settings_Delete(string key)
=> process_SettingsJson(jObj => {
if (jObj.ContainsKey(key))
jObj.Remove(key);
});
/// <param name="save">True: save if contents changed. False: no not attempt save</param>
private static void process_SettingsJson(Action<JObject> action, bool save = true)
{
// only insert if not exists
if (!SettingsJson_Exists)
return;
var startingContents = File.ReadAllText(SettingsJsonPath);
var jObj = JObject.Parse(startingContents);
action(jObj);
if (!save)
return;
// only save if different
var endingContents_indented = jObj.ToString(Formatting.Indented);
var endingContents_compact = jObj.ToString(Formatting.None);
if (startingContents.EqualsInsensitive(endingContents_indented) || startingContents.EqualsInsensitive(endingContents_compact))
return;
File.WriteAllText(SettingsJsonPath, endingContents_indented);
System.Threading.Thread.Sleep(100);
}
#endregion
}
}

View File

@ -28,243 +28,243 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.booksLocationLbl = new System.Windows.Forms.Label(); this.booksLocationLbl = new System.Windows.Forms.Label();
this.booksLocationTb = new System.Windows.Forms.TextBox(); this.booksLocationTb = new System.Windows.Forms.TextBox();
this.booksLocationSearchBtn = new System.Windows.Forms.Button(); this.booksLocationSearchBtn = new System.Windows.Forms.Button();
this.booksLocationDescLbl = new System.Windows.Forms.Label(); this.booksLocationDescLbl = new System.Windows.Forms.Label();
this.downloadsInProgressGb = new System.Windows.Forms.GroupBox(); this.downloadsInProgressGb = new System.Windows.Forms.GroupBox();
this.downloadsInProgressLibationFilesRb = new System.Windows.Forms.RadioButton(); this.downloadsInProgressLibationFilesRb = new System.Windows.Forms.RadioButton();
this.downloadsInProgressWinTempRb = new System.Windows.Forms.RadioButton(); this.downloadsInProgressWinTempRb = new System.Windows.Forms.RadioButton();
this.downloadsInProgressDescLbl = new System.Windows.Forms.Label(); this.downloadsInProgressDescLbl = new System.Windows.Forms.Label();
this.decryptInProgressGb = new System.Windows.Forms.GroupBox(); this.decryptInProgressGb = new System.Windows.Forms.GroupBox();
this.decryptInProgressLibationFilesRb = new System.Windows.Forms.RadioButton(); this.decryptInProgressLibationFilesRb = new System.Windows.Forms.RadioButton();
this.decryptInProgressWinTempRb = new System.Windows.Forms.RadioButton(); this.decryptInProgressWinTempRb = new System.Windows.Forms.RadioButton();
this.decryptInProgressDescLbl = new System.Windows.Forms.Label(); this.decryptInProgressDescLbl = new System.Windows.Forms.Label();
this.saveBtn = new System.Windows.Forms.Button(); this.saveBtn = new System.Windows.Forms.Button();
this.cancelBtn = new System.Windows.Forms.Button(); this.cancelBtn = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.allowLibationFixupCbox = new System.Windows.Forms.CheckBox(); this.allowLibationFixupCbox = new System.Windows.Forms.CheckBox();
this.downloadsInProgressGb.SuspendLayout(); this.downloadsInProgressGb.SuspendLayout();
this.decryptInProgressGb.SuspendLayout(); this.decryptInProgressGb.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// booksLocationLbl // booksLocationLbl
// //
this.booksLocationLbl.AutoSize = true; this.booksLocationLbl.AutoSize = true;
this.booksLocationLbl.Location = new System.Drawing.Point(14, 20); this.booksLocationLbl.Location = new System.Drawing.Point(14, 20);
this.booksLocationLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.booksLocationLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.booksLocationLbl.Name = "booksLocationLbl"; this.booksLocationLbl.Name = "booksLocationLbl";
this.booksLocationLbl.Size = new System.Drawing.Size(85, 15); this.booksLocationLbl.Size = new System.Drawing.Size(85, 15);
this.booksLocationLbl.TabIndex = 0; this.booksLocationLbl.TabIndex = 0;
this.booksLocationLbl.Text = "Books location"; this.booksLocationLbl.Text = "Books location";
// //
// booksLocationTb // booksLocationTb
// //
this.booksLocationTb.Location = new System.Drawing.Point(111, 16); this.booksLocationTb.Location = new System.Drawing.Point(111, 16);
this.booksLocationTb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.booksLocationTb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.booksLocationTb.Name = "booksLocationTb"; this.booksLocationTb.Name = "booksLocationTb";
this.booksLocationTb.Size = new System.Drawing.Size(760, 23); this.booksLocationTb.Size = new System.Drawing.Size(760, 23);
this.booksLocationTb.TabIndex = 1; this.booksLocationTb.TabIndex = 1;
// //
// booksLocationSearchBtn // booksLocationSearchBtn
// //
this.booksLocationSearchBtn.Location = new System.Drawing.Point(878, 14); this.booksLocationSearchBtn.Location = new System.Drawing.Point(878, 14);
this.booksLocationSearchBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.booksLocationSearchBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.booksLocationSearchBtn.Name = "booksLocationSearchBtn"; this.booksLocationSearchBtn.Name = "booksLocationSearchBtn";
this.booksLocationSearchBtn.Size = new System.Drawing.Size(41, 27); this.booksLocationSearchBtn.Size = new System.Drawing.Size(41, 27);
this.booksLocationSearchBtn.TabIndex = 2; this.booksLocationSearchBtn.TabIndex = 2;
this.booksLocationSearchBtn.Text = "..."; this.booksLocationSearchBtn.Text = "...";
this.booksLocationSearchBtn.UseVisualStyleBackColor = true; this.booksLocationSearchBtn.UseVisualStyleBackColor = true;
this.booksLocationSearchBtn.Click += new System.EventHandler(this.booksLocationSearchBtn_Click); this.booksLocationSearchBtn.Click += new System.EventHandler(this.booksLocationSearchBtn_Click);
// //
// booksLocationDescLbl // booksLocationDescLbl
// //
this.booksLocationDescLbl.AutoSize = true; this.booksLocationDescLbl.AutoSize = true;
this.booksLocationDescLbl.Location = new System.Drawing.Point(107, 43); this.booksLocationDescLbl.Location = new System.Drawing.Point(107, 43);
this.booksLocationDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.booksLocationDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.booksLocationDescLbl.Name = "booksLocationDescLbl"; this.booksLocationDescLbl.Name = "booksLocationDescLbl";
this.booksLocationDescLbl.Size = new System.Drawing.Size(39, 15); this.booksLocationDescLbl.Size = new System.Drawing.Size(39, 15);
this.booksLocationDescLbl.TabIndex = 3; this.booksLocationDescLbl.TabIndex = 3;
this.booksLocationDescLbl.Text = "[desc]"; this.booksLocationDescLbl.Text = "[desc]";
// //
// downloadsInProgressGb // downloadsInProgressGb
// //
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressLibationFilesRb); this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressLibationFilesRb);
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressWinTempRb); this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressWinTempRb);
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressDescLbl); this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressDescLbl);
this.downloadsInProgressGb.Location = new System.Drawing.Point(10, 49); this.downloadsInProgressGb.Location = new System.Drawing.Point(10, 49);
this.downloadsInProgressGb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.downloadsInProgressGb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.downloadsInProgressGb.Name = "downloadsInProgressGb"; this.downloadsInProgressGb.Name = "downloadsInProgressGb";
this.downloadsInProgressGb.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); this.downloadsInProgressGb.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.downloadsInProgressGb.Size = new System.Drawing.Size(884, 135); this.downloadsInProgressGb.Size = new System.Drawing.Size(884, 135);
this.downloadsInProgressGb.TabIndex = 4; this.downloadsInProgressGb.TabIndex = 4;
this.downloadsInProgressGb.TabStop = false; this.downloadsInProgressGb.TabStop = false;
this.downloadsInProgressGb.Text = "Downloads in progress"; this.downloadsInProgressGb.Text = "Downloads in progress";
// //
// downloadsInProgressLibationFilesRb // downloadsInProgressLibationFilesRb
// //
this.downloadsInProgressLibationFilesRb.AutoSize = true; this.downloadsInProgressLibationFilesRb.AutoSize = true;
this.downloadsInProgressLibationFilesRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft; this.downloadsInProgressLibationFilesRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.downloadsInProgressLibationFilesRb.Location = new System.Drawing.Point(10, 93); this.downloadsInProgressLibationFilesRb.Location = new System.Drawing.Point(10, 93);
this.downloadsInProgressLibationFilesRb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.downloadsInProgressLibationFilesRb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.downloadsInProgressLibationFilesRb.Name = "downloadsInProgressLibationFilesRb"; this.downloadsInProgressLibationFilesRb.Name = "downloadsInProgressLibationFilesRb";
this.downloadsInProgressLibationFilesRb.Size = new System.Drawing.Size(215, 34); this.downloadsInProgressLibationFilesRb.Size = new System.Drawing.Size(215, 34);
this.downloadsInProgressLibationFilesRb.TabIndex = 2; this.downloadsInProgressLibationFilesRb.TabIndex = 2;
this.downloadsInProgressLibationFilesRb.TabStop = true; this.downloadsInProgressLibationFilesRb.TabStop = true;
this.downloadsInProgressLibationFilesRb.Text = "[desc]\r\n[libationFiles\\DownloadsInProgress]"; this.downloadsInProgressLibationFilesRb.Text = "[desc]\r\n[libationFiles\\DownloadsInProgress]";
this.downloadsInProgressLibationFilesRb.UseVisualStyleBackColor = true; this.downloadsInProgressLibationFilesRb.UseVisualStyleBackColor = true;
// //
// downloadsInProgressWinTempRb // downloadsInProgressWinTempRb
// //
this.downloadsInProgressWinTempRb.AutoSize = true; this.downloadsInProgressWinTempRb.AutoSize = true;
this.downloadsInProgressWinTempRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft; this.downloadsInProgressWinTempRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.downloadsInProgressWinTempRb.Location = new System.Drawing.Point(10, 52); this.downloadsInProgressWinTempRb.Location = new System.Drawing.Point(10, 52);
this.downloadsInProgressWinTempRb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.downloadsInProgressWinTempRb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.downloadsInProgressWinTempRb.Name = "downloadsInProgressWinTempRb"; this.downloadsInProgressWinTempRb.Name = "downloadsInProgressWinTempRb";
this.downloadsInProgressWinTempRb.Size = new System.Drawing.Size(200, 34); this.downloadsInProgressWinTempRb.Size = new System.Drawing.Size(200, 34);
this.downloadsInProgressWinTempRb.TabIndex = 1; this.downloadsInProgressWinTempRb.TabIndex = 1;
this.downloadsInProgressWinTempRb.TabStop = true; this.downloadsInProgressWinTempRb.TabStop = true;
this.downloadsInProgressWinTempRb.Text = "[desc]\r\n[winTemp\\DownloadsInProgress]"; this.downloadsInProgressWinTempRb.Text = "[desc]\r\n[winTemp\\DownloadsInProgress]";
this.downloadsInProgressWinTempRb.UseVisualStyleBackColor = true; this.downloadsInProgressWinTempRb.UseVisualStyleBackColor = true;
// //
// downloadsInProgressDescLbl // downloadsInProgressDescLbl
// //
this.downloadsInProgressDescLbl.AutoSize = true; this.downloadsInProgressDescLbl.AutoSize = true;
this.downloadsInProgressDescLbl.Location = new System.Drawing.Point(7, 18); this.downloadsInProgressDescLbl.Location = new System.Drawing.Point(7, 18);
this.downloadsInProgressDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.downloadsInProgressDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.downloadsInProgressDescLbl.Name = "downloadsInProgressDescLbl"; this.downloadsInProgressDescLbl.Name = "downloadsInProgressDescLbl";
this.downloadsInProgressDescLbl.Size = new System.Drawing.Size(43, 30); this.downloadsInProgressDescLbl.Size = new System.Drawing.Size(43, 30);
this.downloadsInProgressDescLbl.TabIndex = 0; this.downloadsInProgressDescLbl.TabIndex = 0;
this.downloadsInProgressDescLbl.Text = "[desc]\r\n[line 2]"; this.downloadsInProgressDescLbl.Text = "[desc]\r\n[line 2]";
// //
// decryptInProgressGb // decryptInProgressGb
// //
this.decryptInProgressGb.Controls.Add(this.decryptInProgressLibationFilesRb); this.decryptInProgressGb.Controls.Add(this.decryptInProgressLibationFilesRb);
this.decryptInProgressGb.Controls.Add(this.decryptInProgressWinTempRb); this.decryptInProgressGb.Controls.Add(this.decryptInProgressWinTempRb);
this.decryptInProgressGb.Controls.Add(this.decryptInProgressDescLbl); this.decryptInProgressGb.Controls.Add(this.decryptInProgressDescLbl);
this.decryptInProgressGb.Location = new System.Drawing.Point(10, 193); this.decryptInProgressGb.Location = new System.Drawing.Point(10, 193);
this.decryptInProgressGb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.decryptInProgressGb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.decryptInProgressGb.Name = "decryptInProgressGb"; this.decryptInProgressGb.Name = "decryptInProgressGb";
this.decryptInProgressGb.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); this.decryptInProgressGb.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.decryptInProgressGb.Size = new System.Drawing.Size(884, 135); this.decryptInProgressGb.Size = new System.Drawing.Size(884, 135);
this.decryptInProgressGb.TabIndex = 5; this.decryptInProgressGb.TabIndex = 5;
this.decryptInProgressGb.TabStop = false; this.decryptInProgressGb.TabStop = false;
this.decryptInProgressGb.Text = "Decrypt in progress"; this.decryptInProgressGb.Text = "Decrypt in progress";
// //
// decryptInProgressLibationFilesRb // decryptInProgressLibationFilesRb
// //
this.decryptInProgressLibationFilesRb.AutoSize = true; this.decryptInProgressLibationFilesRb.AutoSize = true;
this.decryptInProgressLibationFilesRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft; this.decryptInProgressLibationFilesRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.decryptInProgressLibationFilesRb.Location = new System.Drawing.Point(7, 93); this.decryptInProgressLibationFilesRb.Location = new System.Drawing.Point(7, 93);
this.decryptInProgressLibationFilesRb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.decryptInProgressLibationFilesRb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.decryptInProgressLibationFilesRb.Name = "decryptInProgressLibationFilesRb"; this.decryptInProgressLibationFilesRb.Name = "decryptInProgressLibationFilesRb";
this.decryptInProgressLibationFilesRb.Size = new System.Drawing.Size(197, 34); this.decryptInProgressLibationFilesRb.Size = new System.Drawing.Size(197, 34);
this.decryptInProgressLibationFilesRb.TabIndex = 2; this.decryptInProgressLibationFilesRb.TabIndex = 2;
this.decryptInProgressLibationFilesRb.TabStop = true; this.decryptInProgressLibationFilesRb.TabStop = true;
this.decryptInProgressLibationFilesRb.Text = "[desc]\r\n[libationFiles\\DecryptInProgress]"; this.decryptInProgressLibationFilesRb.Text = "[desc]\r\n[libationFiles\\DecryptInProgress]";
this.decryptInProgressLibationFilesRb.UseVisualStyleBackColor = true; this.decryptInProgressLibationFilesRb.UseVisualStyleBackColor = true;
// //
// decryptInProgressWinTempRb // decryptInProgressWinTempRb
// //
this.decryptInProgressWinTempRb.AutoSize = true; this.decryptInProgressWinTempRb.AutoSize = true;
this.decryptInProgressWinTempRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft; this.decryptInProgressWinTempRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.decryptInProgressWinTempRb.Location = new System.Drawing.Point(7, 52); this.decryptInProgressWinTempRb.Location = new System.Drawing.Point(7, 52);
this.decryptInProgressWinTempRb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.decryptInProgressWinTempRb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.decryptInProgressWinTempRb.Name = "decryptInProgressWinTempRb"; this.decryptInProgressWinTempRb.Name = "decryptInProgressWinTempRb";
this.decryptInProgressWinTempRb.Size = new System.Drawing.Size(182, 34); this.decryptInProgressWinTempRb.Size = new System.Drawing.Size(182, 34);
this.decryptInProgressWinTempRb.TabIndex = 1; this.decryptInProgressWinTempRb.TabIndex = 1;
this.decryptInProgressWinTempRb.TabStop = true; this.decryptInProgressWinTempRb.TabStop = true;
this.decryptInProgressWinTempRb.Text = "[desc]\r\n[winTemp\\DecryptInProgress]"; this.decryptInProgressWinTempRb.Text = "[desc]\r\n[winTemp\\DecryptInProgress]";
this.decryptInProgressWinTempRb.UseVisualStyleBackColor = true; this.decryptInProgressWinTempRb.UseVisualStyleBackColor = true;
// //
// decryptInProgressDescLbl // decryptInProgressDescLbl
// //
this.decryptInProgressDescLbl.AutoSize = true; this.decryptInProgressDescLbl.AutoSize = true;
this.decryptInProgressDescLbl.Location = new System.Drawing.Point(7, 18); this.decryptInProgressDescLbl.Location = new System.Drawing.Point(7, 18);
this.decryptInProgressDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.decryptInProgressDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.decryptInProgressDescLbl.Name = "decryptInProgressDescLbl"; this.decryptInProgressDescLbl.Name = "decryptInProgressDescLbl";
this.decryptInProgressDescLbl.Size = new System.Drawing.Size(43, 30); this.decryptInProgressDescLbl.Size = new System.Drawing.Size(43, 30);
this.decryptInProgressDescLbl.TabIndex = 0; this.decryptInProgressDescLbl.TabIndex = 0;
this.decryptInProgressDescLbl.Text = "[desc]\r\n[line 2]"; this.decryptInProgressDescLbl.Text = "[desc]\r\n[line 2]";
// //
// saveBtn // saveBtn
// //
this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.saveBtn.Location = new System.Drawing.Point(714, 401); this.saveBtn.Location = new System.Drawing.Point(714, 401);
this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.saveBtn.Name = "saveBtn"; this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(88, 27); this.saveBtn.Size = new System.Drawing.Size(88, 27);
this.saveBtn.TabIndex = 7; this.saveBtn.TabIndex = 7;
this.saveBtn.Text = "Save"; this.saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true; this.saveBtn.UseVisualStyleBackColor = true;
this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click); this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click);
// //
// cancelBtn // cancelBtn
// //
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(832, 401); this.cancelBtn.Location = new System.Drawing.Point(832, 401);
this.cancelBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.cancelBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.cancelBtn.Name = "cancelBtn"; this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(88, 27); this.cancelBtn.Size = new System.Drawing.Size(88, 27);
this.cancelBtn.TabIndex = 8; this.cancelBtn.TabIndex = 8;
this.cancelBtn.Text = "Cancel"; this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true; this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click); this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click);
// //
// groupBox1 // groupBox1
// //
this.groupBox1.Controls.Add(this.allowLibationFixupCbox); this.groupBox1.Controls.Add(this.allowLibationFixupCbox);
this.groupBox1.Controls.Add(this.downloadsInProgressGb); this.groupBox1.Controls.Add(this.downloadsInProgressGb);
this.groupBox1.Controls.Add(this.decryptInProgressGb); this.groupBox1.Controls.Add(this.decryptInProgressGb);
this.groupBox1.Location = new System.Drawing.Point(18, 61); this.groupBox1.Location = new System.Drawing.Point(18, 61);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.groupBox1.Size = new System.Drawing.Size(902, 334); this.groupBox1.Size = new System.Drawing.Size(902, 334);
this.groupBox1.TabIndex = 6; this.groupBox1.TabIndex = 6;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "Advanced settings for control freaks"; this.groupBox1.Text = "Advanced settings for control freaks";
// //
// downloadChaptersCbox // allowLibationFixupCbox
// //
this.allowLibationFixupCbox.AutoSize = true; this.allowLibationFixupCbox.AutoSize = true;
this.allowLibationFixupCbox.Location = new System.Drawing.Point(10, 24); this.allowLibationFixupCbox.Location = new System.Drawing.Point(10, 24);
this.allowLibationFixupCbox.Name = "downloadChaptersCbox"; this.allowLibationFixupCbox.Name = "allowLibationFixupCbox";
this.allowLibationFixupCbox.Size = new System.Drawing.Size(262, 19); this.allowLibationFixupCbox.Size = new System.Drawing.Size(262, 19);
this.allowLibationFixupCbox.TabIndex = 6; this.allowLibationFixupCbox.TabIndex = 6;
this.allowLibationFixupCbox.Text = "Allow Libation to fix up audiobook metadata"; this.allowLibationFixupCbox.Text = "Allow Libation to fix up audiobook metadata";
this.allowLibationFixupCbox.UseVisualStyleBackColor = true; this.allowLibationFixupCbox.UseVisualStyleBackColor = true;
// //
// SettingsDialog // SettingsDialog
// //
this.AcceptButton = this.saveBtn; this.AcceptButton = this.saveBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelBtn; this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(933, 442); this.ClientSize = new System.Drawing.Size(933, 442);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.Controls.Add(this.booksLocationDescLbl); this.Controls.Add(this.booksLocationDescLbl);
this.Controls.Add(this.booksLocationSearchBtn); this.Controls.Add(this.booksLocationSearchBtn);
this.Controls.Add(this.booksLocationTb); this.Controls.Add(this.booksLocationTb);
this.Controls.Add(this.booksLocationLbl); this.Controls.Add(this.booksLocationLbl);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.Name = "SettingsDialog"; this.Name = "SettingsDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Settings"; this.Text = "Edit Settings";
this.Load += new System.EventHandler(this.SettingsDialog_Load); this.Load += new System.EventHandler(this.SettingsDialog_Load);
this.downloadsInProgressGb.ResumeLayout(false); this.downloadsInProgressGb.ResumeLayout(false);
this.downloadsInProgressGb.PerformLayout(); this.downloadsInProgressGb.PerformLayout();
this.decryptInProgressGb.ResumeLayout(false); this.decryptInProgressGb.ResumeLayout(false);
this.decryptInProgressGb.PerformLayout(); this.decryptInProgressGb.PerformLayout();
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }

View File

@ -3,7 +3,6 @@ using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using Dinah.Core; using Dinah.Core;
using FileManager; using FileManager;
using InternalUtilities;
namespace LibationWinForms.Dialogs namespace LibationWinForms.Dialogs
{ {
@ -12,10 +11,7 @@ namespace LibationWinForms.Dialogs
Configuration config { get; } = Configuration.Instance; Configuration config { get; } = Configuration.Instance;
Func<string, string> desc { get; } = Configuration.GetDescription; Func<string, string> desc { get; } = Configuration.GetDescription;
public SettingsDialog() public SettingsDialog() => InitializeComponent();
{
InitializeComponent();
}
private void SettingsDialog_Load(object sender, EventArgs e) private void SettingsDialog_Load(object sender, EventArgs e)
{ {

View File

@ -81,6 +81,15 @@
<metadata name="downloadsInProgressDescLbl.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="downloadsInProgressDescLbl.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="downloadsInProgressLibationFilesRb.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="downloadsInProgressWinTempRb.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="downloadsInProgressDescLbl.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="decryptInProgressGb.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="decryptInProgressGb.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
@ -93,6 +102,15 @@
<metadata name="decryptInProgressDescLbl.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="decryptInProgressDescLbl.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="decryptInProgressLibationFilesRb.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="decryptInProgressWinTempRb.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="decryptInProgressDescLbl.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="saveBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="saveBtn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
@ -102,10 +120,4 @@
<metadata name="groupBox1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="groupBox1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="downloadChaptersCbox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> </root>

View File

@ -23,6 +23,8 @@ namespace LibationWinForms.Dialogs
if (this.DesignMode) if (this.DesignMode)
return; return;
{ {
var dirCtrl = this.directorySelectControl1; var dirCtrl = this.directorySelectControl1;
dirCtrl.SetDirectoryItems(new() dirCtrl.SetDirectoryItems(new()
@ -40,36 +42,48 @@ namespace LibationWinForms.Dialogs
); );
} }
//{
// var dirOrCustCtrl = this.directoryOrCustomSelectControl1;
// dirOrCustCtrl.SetSearchTitle("Libation Files"); {
// dirOrCustCtrl.SetDirectoryItems(new() var dirOrCustCtrl = this.directoryOrCustomSelectControl1;
// { dirOrCustCtrl.SetSearchTitle("Libation Files");
// FileManager.Configuration.KnownDirectories.AppDir, dirOrCustCtrl.SetDirectoryItems(new()
// FileManager.Configuration.KnownDirectories.MyDocs, {
// FileManager.Configuration.KnownDirectories.LibationFiles, FileManager.Configuration.KnownDirectories.AppDir,
// FileManager.Configuration.KnownDirectories.MyDocs, FileManager.Configuration.KnownDirectories.MyDocs,
// FileManager.Configuration.KnownDirectories.None, FileManager.Configuration.KnownDirectories.LibationFiles,
// FileManager.Configuration.KnownDirectories.WinTemp, FileManager.Configuration.KnownDirectories.MyDocs,
// FileManager.Configuration.KnownDirectories.UserProfile FileManager.Configuration.KnownDirectories.None,
// } FileManager.Configuration.KnownDirectories.WinTemp,
// , FileManager.Configuration.KnownDirectories.UserProfile
// FileManager.Configuration.KnownDirectories.MyDocs }
// ); ,
//} FileManager.Configuration.KnownDirectories.MyDocs
);
}
} }
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
var dirCtrl = this.directorySelectControl1; var dirCtrl = this.directorySelectControl1;
var x = dirCtrl.SelectedDirectory; var x = dirCtrl.SelectedDirectory;
dirCtrl.SelectDirectory(FileManager.Configuration.KnownDirectories.UserProfile); dirCtrl.SelectDirectory(FileManager.Configuration.KnownDirectories.UserProfile);
//var dirOrCustCtrl = this.directoryOrCustomSelectControl1;
//var y = dirOrCustCtrl.SelectedDirectory;
//dirOrCustCtrl.SelectDirectory(FileManager.Configuration.KnownDirectories.UserProfile);
var dirOrCustCtrl = this.directoryOrCustomSelectControl1;
var y = dirOrCustCtrl.SelectedDirectory;
dirOrCustCtrl.SelectDirectory(FileManager.Configuration.KnownDirectories.UserProfile);
} }
} }
} }