Exemplo n.º 1
0
        public static IBclClass ToBclClass(BclClassProxy bclClassProxy, IFactory factory)
        {
            var formattedDateTime = bclClassProxy as FormattedDateTimeProxy;
            if (formattedDateTime != null)
            {
                return factory.GetOrCreateFormattedDateTime(formattedDateTime.Format);
            }

            var nullableFormattedDateTime = bclClassProxy as NullableFormattedDateTimeProxy;
            if (nullableFormattedDateTime != null)
            {
                return factory.GetOrCreateNullableFormattedDateTime(nullableFormattedDateTime.Format);
            }

            return factory.GetBclClassFromTypeName(bclClassProxy.TypeName);
        }
Exemplo n.º 2
0
        public IClass ToClass(IRepository repository, IFactory factory)
        {
            var userDefinedClassProxy = this as UserDefinedClassProxy;

            if (userDefinedClassProxy != null)
            {
                return(repository.GetOrAdd(userDefinedClassProxy.GetDomPath(factory)));
            }

            var bclClassProxy = this as BclClassProxy;

            if (bclClassProxy != null)
            {
                return(BclClassProxy.ToBclClass(bclClassProxy, factory));
            }

            return(ListClassProxy.ToListClass((ListClassProxy)this, repository, factory));
        }
Exemplo n.º 3
0
        public static IBclClass ToBclClass(BclClassProxy bclClassProxy, IFactory factory)
        {
            var formattedDateTime = bclClassProxy as FormattedDateTimeProxy;

            if (formattedDateTime != null)
            {
                return(factory.GetOrCreateFormattedDateTime(formattedDateTime.Format));
            }

            var nullableFormattedDateTime = bclClassProxy as NullableFormattedDateTimeProxy;

            if (nullableFormattedDateTime != null)
            {
                return(factory.GetOrCreateNullableFormattedDateTime(nullableFormattedDateTime.Format));
            }

            return(factory.GetBclClassFromTypeName(bclClassProxy.TypeName));
        }
Exemplo n.º 4
0
        public static ClassProxy FromClass(IClass @class)
        {
            var userDefinedClass = @class as UserDefinedClass;

            if (userDefinedClass != null)
            {
                return(UserDefinedClassProxy.FromUserDefinedClass(userDefinedClass));
            }

            var bclClass = @class as IBclClass;

            if (bclClass != null)
            {
                return(BclClassProxy.FromBclClass(bclClass));
            }

            return(ListClassProxy.FromListClass((ListClass)@class));
        }