mirror of
https://github.com/tribufu/ServerGridEditor
synced 2026-05-06 15:17:35 +00:00
Initial commit
This commit is contained in:
parent
1aecbe009b
commit
a172b4ab3b
469 changed files with 119758 additions and 0 deletions
42
Src/AtlasGridDataLibrary/DeploymentOverrideAttribute.cs
Normal file
42
Src/AtlasGridDataLibrary/DeploymentOverrideAttribute.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AtlasGridDataLibrary
|
||||
{
|
||||
public class DeploymentAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class DeploymentOverrideAttribute : DeploymentAttribute
|
||||
{
|
||||
}
|
||||
public class DeploymentConstAttribute : DeploymentAttribute
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public class DeploymentOverrideShouldSerializeContractResolver : DefaultContractResolver
|
||||
{
|
||||
//public new static readonly ShouldSerializeContractResolver Instance = new ShouldSerializeContractResolver();
|
||||
|
||||
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
|
||||
{
|
||||
JsonProperty property = base.CreateProperty(member, memberSerialization);
|
||||
|
||||
bool bShouldSersialize = member.GetCustomAttributes().OfType<DeploymentAttribute>().Any();
|
||||
property.ShouldSerialize =
|
||||
instance =>
|
||||
{
|
||||
return bShouldSersialize;
|
||||
};
|
||||
|
||||
return property;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue