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); }
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); }