Пример #1
0
        internal static object DataTypeForItem(object item, DependencyObject target, out Type type)
        {
            if (item == null)
            {
                type = null;
                return(null);
            }

            object dataType;

            type = ReflectionHelper.GetReflectionType(item);

            if (SystemXmlLinqHelper.IsXElement(item))
            {
                dataType = SystemXmlLinqHelper.GetXElementTagName(item);
                type     = null;
            }
            else if (SystemXmlHelper.IsXmlNode(item))
            {
                dataType = SystemXmlHelper.GetXmlTagName(item, target);
                type     = null;
            }
            else if (type == typeof(Object))
            {
                dataType = null;     // don't search for Object - perf
            }
            else
            {
                dataType = type;
            }

            return(dataType);
        }
        // Token: 0x06004412 RID: 17426 RVA: 0x00136610 File Offset: 0x00134810
        internal static object DataTypeForItem(object item, DependencyObject target, out Type type)
        {
            if (item == null)
            {
                type = null;
                return(null);
            }
            type = ReflectionHelper.GetReflectionType(item);
            object result;

            if (SystemXmlLinqHelper.IsXElement(item))
            {
                result = SystemXmlLinqHelper.GetXElementTagName(item);
                type   = null;
            }
            else if (SystemXmlHelper.IsXmlNode(item))
            {
                result = SystemXmlHelper.GetXmlTagName(item, target);
                type   = null;
            }
            else if (type == typeof(object))
            {
                result = null;
            }
            else
            {
                result = type;
            }
            return(result);
        }