public static List <Plt.IComosDDevice> SearchObjectByDescription(string strValorBuscar, Plt.IComosDProject project) { Plt.IComosDSearchManager SearchManager = AppGlobal.Workset.GetSearchManager(); dynamic resultset = null; List <Plt.IComosDDevice> listaRetorno = new List <Plt.IComosDDevice>(); Log.WriteLog("SearchObjectByDescription: START::" + strValorBuscar + "::" + (project == null).ToString()); System.Diagnostics.Debug.WriteLine(SearchManager == null); SearchManager.SystemType = 8; SearchManager.IsSearchCaseSensitive = false; SearchManager.RootObjects.Add(project); SearchManager.AppendSearchCondition("", "PROPERTY", "DESCRIPTION", "LIKE", "*" + strValorBuscar + "*"); SearchManager.AppendSearchCondition("OR", "PROPERTY", "NAME", "LIKE", "*" + strValorBuscar + "*"); resultset = SearchManager.Start(); SearchManager.RetrieveData(0); for (int i = 1; i <= resultset.count; i++) { Plt.IComosDDevice curDev = (Plt.IComosDDevice)resultset.item(i); if (curDev.Layers != "~" && curDev.CObject != null) { listaRetorno.Add(resultset.item(i)); } } SearchManager.Stop(); Log.WriteLog("SearchManager.Stop: OK"); return(listaRetorno); }
public static List <Plt.IComosDSpecification> SearchObjectByValue(string strValorBuscar, Plt.IComosDProject project) { Plt.IComosDSearchManager SearchManager = AppGlobal.Workset.GetSearchManager(); //Plt.IComosDSearchCondition condicao = null; dynamic resultset = null; List <Plt.IComosDSpecification> listaRetorno = new List <Plt.IComosDSpecification>(); System.Diagnostics.Debug.WriteLine(SearchManager == null); SearchManager.SystemType = 10; SearchManager.IsSearchCaseSensitive = false; SearchManager.RootObjects.Add(project); SearchManager.AppendSearchCondition("", "PROPERTY", "VALUE", "LIKE", "*" + strValorBuscar + "*"); //condicao = (Plt.IComosDSearchCondition)SearchManager.SearchConditions.Item[1]; //condicao.IsSearchCaseSensitive = false; resultset = SearchManager.Start(); SearchManager.RetrieveData(0); for (int i = 1; i <= resultset.count; i++) { listaRetorno.Add(resultset.item(i)); Plt.IComosDSpecification curSpec = (Plt.IComosDSpecification)resultset.item(i); if (curSpec.Layers != "~") { listaRetorno.Add(resultset.item(i)); } } SearchManager.Stop(); return(listaRetorno); }
public static List <Plt.IComosDDocument> SearchDocuments(string strValorBuscar, Plt.IComosDProject project) { Plt.IComosDSearchManager SearchManager = AppGlobal.Workset.GetSearchManager(); dynamic resultset = null; Plt.IComosDDocument curDocument = null; List <Plt.IComosDDocument> listaRetorno = new List <Plt.IComosDDocument>(); System.Diagnostics.Debug.WriteLine(SearchManager == null); SearchManager.SystemType = 29; SearchManager.IsSearchCaseSensitive = false; SearchManager.RootObjects.Add(project); SearchManager.AppendSearchCondition("", "PROPERTY", "DESCRIPTION", "LIKE", "*" + strValorBuscar + "*"); SearchManager.AppendSearchCondition("OR", "PROPERTY", "NAME", "LIKE", "*" + strValorBuscar + "*"); resultset = SearchManager.Start(); SearchManager.RetrieveData(0); Log.WriteLog("SearchDocuments.rowCount: " + resultset.count); for (int i = 1; i <= resultset.count; i++) { curDocument = (Plt.IComosDDocument)resultset.item(i); if (!curDocument.IsDdmVersion()) { if (curDocument.Layers != "~") { listaRetorno.Add(curDocument); } } } SearchManager.Stop(); return(listaRetorno); }