Exemplo n.º 1
0
        private bool ProcessClientClassType(Type type)
        {
            if (_EntityClasses.ContainsKey(type))
            {
                return(true);
            }
            else if (type.UnderlyingSystemType == typeof(Object))
            {
                return(true);
            }

            EntityMetaAttribute meta = null;

            foreach (var att in Attribute.GetCustomAttributes(type))
            {
                if (att.GetType() != typeof(EntityMetaAttribute))
                {
                    continue;
                }

                meta = att as EntityMetaAttribute;
                break;
            }

            ClientClass cc = null;

            if (meta != null)
            {
                cc = new ClientClass(type.Name, meta);
            }
            else
            {
                cc = new ClientClass(type.Name);
            }

            if (!ProcessClientProps(type, cc))
            {
                return(false);
            }

            _EntityClasses.Add(type, cc);
            return(ProcessClientClassType(type.BaseType));
        }
Exemplo n.º 2
0
        public ClientClass(string className, EntityMetaAttribute meta)
        {
            if (meta != null && !String.IsNullOrEmpty(meta.ClassName))
            {
                Name = meta.ClassName;
            }
            else
            {
                Name = className;
            }

            if (meta != null && !String.IsNullOrEmpty(meta.SentTableName))
            {
                RecvNetTableName = meta.SentTableName;
            }
            else
            {
                RecvNetTableName = className;
            }
        }