Ejemplo n.º 1
0
        public static string GetObjectXmlPath(object oContainer, object oNeedle)
        {
            if (oContainer == null)
            {
                Debug.Assert(false); return(null);
            }

            XuopContainer c        = new XuopContainer(oContainer);
            string        strXPath = GetObjectXmlPathRec(c, typeof(XuopContainer),
                                                         oNeedle, string.Empty);

            if (string.IsNullOrEmpty(strXPath))
            {
                return(strXPath);
            }

            if (!strXPath.StartsWith("/Object"))
            {
                Debug.Assert(false); return(null);
            }
            strXPath = strXPath.Substring(7);

            Type   tRoot   = oContainer.GetType();
            string strRoot = XmlSerializerEx.GetXmlName(tRoot);

            return(GoxpSep + strRoot + strXPath);
        }
Ejemplo n.º 2
0
        public static string GetObjectXmlPath(object oContainer, object oNeedle)
        {
            if(oContainer == null) { Debug.Assert(false); return null; }

            XuopContainer c = new XuopContainer(oContainer);
            string strXPath = GetObjectXmlPathRec(c, typeof(XuopContainer),
                oNeedle, string.Empty);
            if(string.IsNullOrEmpty(strXPath)) return strXPath;

            if(!strXPath.StartsWith("/Object")) { Debug.Assert(false); return null; }
            strXPath = strXPath.Substring(7);

            Type tRoot = oContainer.GetType();
            string strRoot = XmlSerializerEx.GetXmlName(tRoot);

            return (GoxpSep + strRoot + strXPath);
        }