Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/ToDoList.tdl
Binary file not shown.
2 changes: 1 addition & 1 deletion source/Xeno.ToolsHub.Tests/Xeno.ToolsHub.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\output\tests\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
20 changes: 20 additions & 0 deletions source/Xeno.ToolsHub/Config/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,26 @@ public static string FileSerialize(object o, string fileName = null, bool indent
return data;
}

/// <summary>Convert JSON to object.</summary>
/// <typeparam name="T">Type of object to deserialize.</typeparam>
/// <param name="json">JSON string.</param>
/// <returns>Converted object.</returns>
public static object ToObject<T>(string json)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(json);
}

/// <summary>Convert object to JSON.</summary>
/// <param name="obj">object to serialize.</param>
/// <returns>JSON text.</returns>
public static string ToJson(object obj, bool format = false)
{
string json = Newtonsoft.Json.JsonConvert.SerializeObject(
obj,
format ? Formatting.Indented : Formatting.None);
return json;
}

/// <summary>Generate a new GUID</summary>
/// <returns>GUID/UUID string</returns>
public static string GenerateGuid()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading