Drag-Drop-Set-Property-Item
This commit is contained in:
4
Drag-Drop-Move/DragDropMove.Designer.cs
generated
4
Drag-Drop-Move/DragDropMove.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace View_by_Distance.Drag_Drop_Explorer;
|
||||
namespace View_by_Distance.Drag.Drop.Move;
|
||||
|
||||
partial class DragDropMove
|
||||
{
|
||||
@ -32,7 +32,7 @@ partial class DragDropMove
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(640, 100);
|
||||
this.StartPosition = FormStartPosition.CenterScreen;
|
||||
this.Text = "Drag Drop Explorer";
|
||||
this.Text = "Drag Drop Move";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -4,11 +4,11 @@ using Serilog;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using View_by_Distance.Drag_Drop_Explorer.Models;
|
||||
using View_by_Distance.Drag.Drop.Move.Models;
|
||||
using View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
using WindowsShortcutFactory;
|
||||
|
||||
namespace View_by_Distance.Drag_Drop_Explorer;
|
||||
namespace View_by_Distance.Drag.Drop.Move;
|
||||
|
||||
public partial class DragDropMove : Form
|
||||
{
|
||||
|
@ -1,23 +1,12 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Drag_Drop_Explorer.Models;
|
||||
namespace View_by_Distance.Drag.Drop.Move.Models;
|
||||
|
||||
public class AppSettings
|
||||
public record AppSettings(string Company,
|
||||
int MaxDegreeOfParallelism,
|
||||
string WorkingDirectoryName)
|
||||
{
|
||||
|
||||
public string Company { init; get; }
|
||||
public int MaxDegreeOfParallelism { init; get; }
|
||||
public string WorkingDirectoryName { init; get; }
|
||||
|
||||
[JsonConstructor]
|
||||
public AppSettings(string company, int maxDegreeOfParallelism, string workingDirectoryName)
|
||||
{
|
||||
Company = company;
|
||||
MaxDegreeOfParallelism = maxDegreeOfParallelism;
|
||||
WorkingDirectoryName = workingDirectoryName;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
|
@ -1,18 +1,14 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace View_by_Distance.Drag_Drop_Explorer.Models.Binder;
|
||||
namespace View_by_Distance.Drag.Drop.Move.Models.Binder;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
|
||||
#nullable disable
|
||||
|
||||
public string Company { get; set; }
|
||||
public string? Company { get; set; }
|
||||
public int? MaxDegreeOfParallelism { get; set; }
|
||||
public string WorkingDirectoryName { get; set; }
|
||||
|
||||
#nullable restore
|
||||
public string? WorkingDirectoryName { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
@ -23,8 +19,12 @@ public class AppSettings
|
||||
private static Models.AppSettings Get(AppSettings? appSettings)
|
||||
{
|
||||
Models.AppSettings result;
|
||||
if (appSettings?.Company is null)
|
||||
throw new NullReferenceException(nameof(appSettings.Company));
|
||||
if (appSettings?.MaxDegreeOfParallelism is null)
|
||||
throw new NullReferenceException(nameof(appSettings.MaxDegreeOfParallelism));
|
||||
if (appSettings?.WorkingDirectoryName is null)
|
||||
throw new NullReferenceException(nameof(appSettings.WorkingDirectoryName));
|
||||
result = new(
|
||||
appSettings.Company,
|
||||
appSettings.MaxDegreeOfParallelism.Value,
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace View_by_Distance.Drag_Drop_Explorer;
|
||||
namespace View_by_Distance.Drag.Drop.Move;
|
||||
|
||||
public class Program
|
||||
{
|
||||
|
Reference in New Issue
Block a user