~ubuntu-branches/ubuntu/trusty/smuxi/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/ServiceStack/src/ServiceStack.Common/Extensions/ReflectionExtensions.cs

  • Committer: Package Import Robot
  • Author(s): Mirco Bauer
  • Date: 2013-05-25 22:11:31 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20130525221131-nd2mc0kzubuwyx20
Tags: 0.8.11-1
* [22d13d5] Imported Upstream version 0.8.11
* [6d2b95a] Refreshed patches
* [89eb66e] Added ServiceStack libraries to smuxi-engine package
* [848ab10] Enable Campfire engine
* [c6dbdc7] Always build db4o for predictable build result
* [13ec489] Exclude OS X specific libraries from dh_clideps

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.Reflection;
 
3
 
 
4
using Proxy = ServiceStack.Common.ReflectionExtensions;
 
5
 
 
6
namespace ServiceStack.Common.Extensions
 
7
{
 
8
    public static class ReflectionExtensions
 
9
    {
 
10
        public static To PopulateWith<To, From>(this To to, From from)
 
11
        {
 
12
            return Proxy.PopulateWith(to, from);
 
13
        }
 
14
 
 
15
        public static To PopulateWithNonDefaultValues<To, From>(this To to, From from)
 
16
        {
 
17
            return Proxy.PopulateWithNonDefaultValues(to, from);
 
18
        }
 
19
 
 
20
        public static To PopulateFromPropertiesWithAttribute<To, From, TAttr>(this To to, From from)
 
21
        {
 
22
            return Proxy.PopulateFromPropertiesWithAttribute<To, From, TAttr>(to, from);
 
23
        }
 
24
 
 
25
        public static T TranslateTo<T>(this object from)
 
26
            where T : new()
 
27
        {
 
28
            return Proxy.TranslateTo<T>(from);
 
29
        }
 
30
 
 
31
        public static TAttribute FirstAttribute<TAttribute>(this Type type)
 
32
        {
 
33
            return Proxy.FirstAttribute<TAttribute>(type);
 
34
        }
 
35
 
 
36
        public static TAttribute FirstAttribute<TAttribute>(this Type type, bool inherit)
 
37
        {
 
38
            return Proxy.FirstAttribute<TAttribute>(type, inherit);
 
39
        }
 
40
 
 
41
        public static TAttribute FirstAttribute<TAttribute>(this PropertyInfo propertyInfo)
 
42
        {
 
43
            return Proxy.FirstAttribute<TAttribute>(propertyInfo);
 
44
        }
 
45
 
 
46
        public static TAttribute FirstAttribute<TAttribute>(this PropertyInfo propertyInfo, bool inherit)
 
47
        {
 
48
            return Proxy.FirstAttribute<TAttribute>(propertyInfo, inherit);
 
49
        }
 
50
 
 
51
        public static bool IsGenericType(this Type type)
 
52
        {
 
53
            return Proxy.IsGenericType(type);
 
54
        }
 
55
 
 
56
        public static Type FirstGenericTypeDefinition(this Type type)
 
57
        {
 
58
            return Proxy.FirstGenericTypeDefinition(type);
 
59
        }
 
60
    }
 
61
}