Ejemplo n.º 1
0
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            string strvalue = value as string;

            if (strvalue != null)
            {
                AddressBase addr = AddressBase.Factory(strvalue);
                return(addr);
            }
            else
            {
                return(new AddressBase());
            }
        }
Ejemplo n.º 2
0
        public static AddressBase GetAddress(Object address, Object type)
        {
            AddressBase ret;

            if (Convert.IsDBNull(address) || Convert.IsDBNull(type))
            {
                ret = new AddressBase();
            }
            else
            {
                try
                {
                    ret = AddressBase.Factory(address.ToString(), (AddressType)(Convert.ToInt32(type)));
                }
                catch
                {
                    ret = new EmptyAddress();
                }
            }
            return(ret);
        }