首次提交:本地项目同步到Gitea
This commit is contained in:
40
LibShapes/Core/Serialize/ISerialize.cs
Normal file
40
LibShapes/Core/Serialize/ISerialize.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Io.Github.Kerwinxu.LibShapes.Core.Serialize
|
||||
{
|
||||
/// <summary>
|
||||
/// 序列化接口
|
||||
/// </summary>
|
||||
public interface ISerialize
|
||||
{
|
||||
/// <summary>
|
||||
/// 序列化
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
string SerializeObject(Object obj);
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
T DeserializeObject<T>(string value);
|
||||
|
||||
// 这里表示从文件中序列化和反序列化
|
||||
|
||||
/// <summary>
|
||||
/// 序列化到文件
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <param name="file_path"></param>
|
||||
void SerializeObjectToFile(Object obj, string file_path);
|
||||
|
||||
|
||||
T DeserializeObjectFromFile<T>(string file_path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user