InvariantCultureSerializer
异相文化 异相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相
方法
public static SettingsStorage DeserializeInvariant(IFileSystem fileSystem, string fileName)
result = InvariantCultureSerializer.DeserializeInvariant(fileSystem, fileName)
使用 IFileSystem 将指定的文件的存储去序列化 。
- fileSystem
- 文件系统。
- fileName
- 档案名.
返回值: SettingsStorage
public static SettingsStorage DeserializeInvariant(string fileName)
result = InvariantCultureSerializer.DeserializeInvariant(fileName)
从指定的文件中去序列化存储 。
- fileName
- 档案名.
返回值: SettingsStorage
public static SettingsStorage DeserializeInvariant(string fileName, IFileSystem fileSystem)
result = InvariantCultureSerializer.DeserializeInvariant(fileName, fileSystem)
从指定的文件中去序列化存储 。
- fileName
- 档案名.
- fileSystem
- 文件系统。
返回值: SettingsStorage
public static SettingsStorage DeserializeInvariant(byte[] data)
result = InvariantCultureSerializer.DeserializeInvariant(data)
从指定的字节数组中去序列化存储 。
- data
- 数据。
返回值: SettingsStorage
public static ValueTask<SettingsStorage> DeserializeInvariantAsync(IFileSystem fileSystem, string fileName, CancellationToken cancellationToken)
result = InvariantCultureSerializer.DeserializeInvariantAsync(fileSystem, fileName, cancellationToken)
Deserialize storage from the specified file using IFileSystem.
- fileSystem
- File system.
- fileName
- File name.
- cancellationToken
- CancellationToken
返回值: SettingsStorage
public static ValueTask<SettingsStorage> DeserializeInvariantAsync(string fileName, IFileSystem fileSystem, CancellationToken cancellationToken)
result = InvariantCultureSerializer.DeserializeInvariantAsync(fileName, fileSystem, cancellationToken)
Deserialize storage from the specified file.
- fileName
- File name.
- fileSystem
- File system.
- cancellationToken
- CancellationToken
返回值: SettingsStorage
public static ValueTask<SettingsStorage> DeserializeInvariantAsync(byte[] data, CancellationToken cancellationToken)
result = InvariantCultureSerializer.DeserializeInvariantAsync(data, cancellationToken)
Deserialize storage from the specified byte array.
- data
- Data.
- cancellationToken
- CancellationToken
返回值: SettingsStorage
public static ValueTask<T> DeserializeInvariantAsync<T>(string fileName, IFileSystem fileSystem, CancellationToken cancellationToken)
result = InvariantCultureSerializer.DeserializeInvariantAsync(fileName, fileSystem, cancellationToken)
Deserialize storage from the specified file.
- fileName
- File name.
- fileSystem
- File system.
- cancellationToken
- CancellationToken
public static T DeserializeInvariant<T>(string fileName, IFileSystem fileSystem)
result = InvariantCultureSerializer.DeserializeInvariant(fileName, fileSystem)
从指定的文件中去序列化存储 。
- fileName
- 档案名.
- fileSystem
- 文件系统。
public static void SerializeInvariant(SettingsStorage settings, IFileSystem fileSystem, string fileName, bool bom)
InvariantCultureSerializer.SerializeInvariant(settings, fileSystem, fileName, bom)
使用 IFileSystem 将指定的存储序列化为文件 。
- settings
- SettingsStorage
- fileSystem
- 文件系统。
- fileName
- 档案名.
- bom
- 添加 UTF8 BOM 序言.
public static void SerializeInvariant(SettingsStorage settings, string fileName, bool bom)
InvariantCultureSerializer.SerializeInvariant(settings, fileName, bom)
将指定的存储序列化为文件 。
- settings
- SettingsStorage
- fileName
- 档案名.
- bom
- 添加 UTF8 BOM 序言.
public static byte[] SerializeInvariant(IAsyncPersistable settings, bool bom)
result = InvariantCultureSerializer.SerializeInvariant(settings, bom)
Serialize the specified storage into byte array.
- settings
- IAsyncPersistable
- bom
- Add UTF8 BOM preamble.
public static byte[] SerializeInvariant(SettingsStorage settings, bool bom)
result = InvariantCultureSerializer.SerializeInvariant(settings, bom)
将指定的存储序列化为字节数组 。
- settings
- SettingsStorage
- bom
- 添加 UTF8 BOM 序言.
public static ValueTask SerializeInvariantAsync(SettingsStorage settings, IFileSystem fileSystem, string fileName, bool bom, CancellationToken cancellationToken)
result = InvariantCultureSerializer.SerializeInvariantAsync(settings, fileSystem, fileName, bom, cancellationToken)
Serialize the specified storage into file.
- settings
- SettingsStorage
- fileSystem
- File system.
- fileName
- File name.
- bom
- Add UTF8 BOM preamble.
- cancellationToken
- CancellationToken
返回值: ValueTask
public static ValueTask<byte[]> SerializeInvariantAsync(IAsyncPersistable settings, bool bom, CancellationToken cancellationToken)
result = InvariantCultureSerializer.SerializeInvariantAsync(settings, bom, cancellationToken)
Serialize the specified settings into byte array.
- settings
- IAsyncPersistable
- bom
- Add UTF8 BOM preamble.
- cancellationToken
- CancellationToken
返回值: Serialized data.
public static ValueTask<byte[]> SerializeInvariantAsync(SettingsStorage settings, bool bom, CancellationToken cancellationToken)
result = InvariantCultureSerializer.SerializeInvariantAsync(settings, bom, cancellationToken)
Serialize the specified storage into byte array.
- settings
- SettingsStorage
- bom
- Add UTF8 BOM preamble.
- cancellationToken
- CancellationToken
返回值: Serialized data.