mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-02-08 13:40:58 -05:00
45 lines
805 B
C#
45 lines
805 B
C#
using Sandbox;
|
|
using System;
|
|
|
|
[AttributeUsage( AttributeTargets.Property )]
|
|
[CodeGenerator( CodeGeneratorFlags.WrapPropertySet | CodeGeneratorFlags.Instance, "OnWrapSet" )]
|
|
[CodeGenerator( CodeGeneratorFlags.WrapPropertySet | CodeGeneratorFlags.Static, "WrapSet.OnWrapSetStatic" )]
|
|
public class WrapSet : Attribute
|
|
{
|
|
public static void OnWrapSetStatic<T>( WrappedPropertySet<T> p )
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
public partial class TestWrapSet
|
|
{
|
|
[WrapSet]
|
|
public static bool StaticProperty { get; set; }
|
|
|
|
[WrapSet]
|
|
public bool InstanceProperty { set; }
|
|
|
|
internal void OnWrapSet<T>( WrappedPropertySet<T> p )
|
|
{
|
|
return null;
|
|
}
|
|
|
|
[WrapSet]
|
|
public bool FieldKeywordProperty
|
|
{
|
|
set
|
|
{
|
|
field = value;
|
|
}
|
|
get => field;
|
|
}
|
|
|
|
[WrapSet]
|
|
public bool FieldKeywordPropertyAuto
|
|
{
|
|
set;
|
|
get => field;
|
|
}
|
|
}
|