mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 22:56:29 +00:00
save window position and left and right panel size
This commit is contained in:
@@ -18,11 +18,16 @@ public class Config
|
||||
public List<AnnotationClass> AnnotationClasses { get; set; } = [];
|
||||
|
||||
private Dictionary<int, AnnotationClass>? _annotationClassesDict;
|
||||
public Dictionary<int, AnnotationClass> AnnotationClassesDict => _annotationClassesDict ??= AnnotationClasses.ToDictionary(x => x.Id);
|
||||
public Dictionary<int, AnnotationClass> AnnotationClassesDict => _annotationClassesDict ??= AnnotationClasses.ToDictionary(x => x.Id);
|
||||
|
||||
public Size WindowSize { get; set; }
|
||||
public Point WindowLocation { get; set; }
|
||||
public bool ShowHelpOnStart { get; set; }
|
||||
public Size WindowSize { get; set; }
|
||||
public Point WindowLocation { get; set; }
|
||||
public bool FullScreen { get; set; }
|
||||
|
||||
public double LeftPanelWidth { get; set; }
|
||||
public double RightPanelWidth { get; set; }
|
||||
|
||||
public bool ShowHelpOnStart { get; set; }
|
||||
}
|
||||
|
||||
public interface IConfigRepository
|
||||
@@ -63,15 +68,8 @@ public class FileConfigRepository(ILogger<FileConfigRepository> logger) : IConfi
|
||||
ShowHelpOnStart = true
|
||||
};
|
||||
}
|
||||
try
|
||||
{
|
||||
var str = File.ReadAllText(CONFIG_PATH);
|
||||
return JsonConvert.DeserializeObject<Config>(str) ?? new Config();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return new Config();
|
||||
}
|
||||
var str = File.ReadAllText(CONFIG_PATH);
|
||||
return JsonConvert.DeserializeObject<Config>(str) ?? new Config();
|
||||
}
|
||||
|
||||
public void Save(Config config)
|
||||
|
||||
Reference in New Issue
Block a user