Пример #1
0
        public static RemotableContent Get(Type t)
        {
            RemotableContent res;

            if (instances.TryGetValue(t, out res))
            {
                return(res);
            }
            res          = new RemotableContent(t);
            instances[t] = res;
            return(res);
        }
Пример #2
0
        static Json.Node BuildObjectDescription(object obj, PerObjectParams param)
        {
            var type        = obj.GetType();
            var description = new Json.Object();
            HashSet <string> allowedFields = param?.TryGet(type.FullName);

            foreach (var kv in RemotableContent.Get(type).Exported)
            {
                description.Add(
                    kv.Key,
                    BuildMember(
                        kv.Value,
                        obj,
                        allowedFields?.Contains(kv.Key) ?? false));
            }

            return(description);
        }
Пример #3
0
 public void ManualRegisterMember(Type type, System.Reflection.MemberInfo info, Dictionary <string, object> moreInfo)
 {
     RemotableContent.Get(type).AddMember(info, moreInfo);
 }