Table of Contents

Class ConfigProfileManager

Namespace
Ink_Canvas.Helpers
Assembly
InkCanvasForClass.dll

提供多配置文件保存、切换与热重载支持。 方案保存在 Configs/Profiles 目录下,当前生效的配置仍为 Configs/Settings.json。

public static class ConfigProfileManager
Inheritance
ConfigProfileManager
Inherited Members

Methods

ApplyProfile(string)

将指定配置文件应用到当前配置(覆盖 Configs/Settings.json),供主窗口随后热重载。

public static bool ApplyProfile(string profileName)

Parameters

profileName string

配置文件名称(与 ListProfileNames 中一致,或与保存时使用的显示名一致)。

Returns

bool

成功返回 true;文件不存在或复制失败返回 false。

DeleteProfile(string)

删除指定名称的配置文件。

public static bool DeleteProfile(string profileName)

Parameters

profileName string

Returns

bool

EnsureProfilesDirectory()

确保配置文件目录存在。

public static void EnsureProfilesDirectory()

GetProfilePath(string)

获取某配置文件对应的文件路径。

public static string GetProfilePath(string profileName)

Parameters

profileName string

Returns

string

ListProfileNames()

获取所有配置文件名称(不含扩展名),按名称排序。

public static IReadOnlyList<string> ListProfileNames()

Returns

IReadOnlyList<string>

SaveAsProfile(string, string)

将当前配置的 JSON 内容保存为指定名称的配置文件。

public static bool SaveAsProfile(string profileName, string settingsJson)

Parameters

profileName string

配置文件显示名称(会转为安全文件名)。

settingsJson string

已序列化好的 Settings JSON 字符串。

Returns

bool

成功返回 true。