webdav portal filter + detail view added
This commit is contained in:
parent
280628e362
commit
51d432fd2e
156 changed files with 32494 additions and 260 deletions
|
@ -0,0 +1,41 @@
|
|||
using System.IO;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace WebsitePanel.WebDav.Core.Helper
|
||||
{
|
||||
public class SerializeHelper
|
||||
{
|
||||
public static TResult Deserialize<TResult>(string inputString)
|
||||
{
|
||||
TResult result;
|
||||
|
||||
var serializer = new XmlSerializer(typeof(TResult));
|
||||
|
||||
using (TextReader reader = new StringReader(inputString))
|
||||
{
|
||||
result = (TResult)serializer.Deserialize(reader);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string Serialize<TEntity>(TEntity entity)
|
||||
{
|
||||
string result = string.Empty;
|
||||
|
||||
var xmlSerializer = new XmlSerializer(typeof(TEntity));
|
||||
|
||||
using (var stringWriter = new StringWriter())
|
||||
{
|
||||
using (XmlWriter writer = XmlWriter.Create(stringWriter))
|
||||
{
|
||||
xmlSerializer.Serialize(writer, entity);
|
||||
result = stringWriter.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue