public string GetXPath(bool bExcludeSessionRootPath) { if (string.IsNullOrEmpty(this._strPath)) { this._strPath = GenerateXPath.GenerateXPathToUiElement(this, _pathNodes, ref _uiTreeNode).Trim(); } if (string.IsNullOrEmpty(this._strPath)) { return(string.Empty); } string xPathRet = this._strPath; if (bExcludeSessionRootPath == true && string.IsNullOrEmpty(MainWindow.s_mainWin.RootSessionPath) == false) { int nPos = xPathRet.IndexOf(MainWindow.s_mainWin.RootSessionPath); if (nPos >= 0) { xPathRet = "\"" + xPathRet.Substring(nPos + MainWindow.s_mainWin.RootSessionPath.Length); } } return(xPathRet); }
public string GetXPath() { if (_strXPath == null) { _strXPath = GenerateXPath.GenerateXPathToUiElement(_strXmlNode).Trim(); } return(_strXPath); }