mirror of
				https://github.com/esiur/esiur-dotnet.git
				synced 2025-10-30 23:51:34 +00:00 
			
		
		
		
	Add project files.
This commit is contained in:
		
							
								
								
									
										48
									
								
								Esiur/Resource/Storable.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								Esiur/Resource/Storable.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,48 @@ | ||||
| using Esiur.Data; | ||||
| using Esiur.Engine; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Text; | ||||
| using System.Threading.Tasks; | ||||
|  | ||||
| namespace Esiur.Resource | ||||
| { | ||||
|     [AttributeUsage(AttributeTargets.All)] | ||||
|     public class Storable : global::System.Attribute | ||||
|     { | ||||
|         public delegate object SerializerFunction(object value); | ||||
|         public delegate object DeserializerFunction(object data); | ||||
|  | ||||
|         SerializerFunction serializer; | ||||
|         DeserializerFunction deserializer; | ||||
|         DataType type; | ||||
|  | ||||
|         public Storable() | ||||
|         { | ||||
|             type = DataType.Void; | ||||
|         } | ||||
|  | ||||
|         public DeserializerFunction Deserializer | ||||
|         { | ||||
|             get { return deserializer; } | ||||
|         } | ||||
|  | ||||
|         public SerializerFunction Serializer | ||||
|         { | ||||
|             get { return serializer; } | ||||
|         } | ||||
|  | ||||
|         public Storable(DataType type) | ||||
|         { | ||||
|             this.type = type; | ||||
|         } | ||||
|  | ||||
|         public Storable(DataType type, SerializerFunction serializer, DeserializerFunction deserializer) | ||||
|         { | ||||
|             this.type = type; | ||||
|             this.serializer = serializer; | ||||
|             this.deserializer = deserializer; | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user