Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
AccessorMetadata.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 
5 namespace SiliconStudio.Core
6 {
8  {
9  public delegate void SetterDelegate(ref PropertyContainer propertyContainer, object value);
10  public delegate object GetterDelegate(ref PropertyContainer propertyContainer);
11 
12 
13  private SetterDelegate setter;
14  private GetterDelegate getter;
15 
16  public AccessorMetadata(GetterDelegate getter, SetterDelegate setter)
17  {
18  this.getter = getter;
19  this.setter = setter;
20  }
21 
22  public object GetValue(ref PropertyContainer obj)
23  {
24  return getter(ref obj);
25  }
26 
27  public void SetValue(ref PropertyContainer obj, object value)
28  {
29  setter(ref obj, value);
30  }
31  }
32 }
void SetValue(ref PropertyContainer obj, object value)
Represents a container that can hold properties, lightweight to embed (lazy initialized).
AccessorMetadata(GetterDelegate getter, SetterDelegate setter)
object GetValue(ref PropertyContainer obj)
Specifies metadata for an PropertyKey.