private IEnumerable <EntityItemSource> GraphTypeList() { if (this.AssigmentMap.Current == null) { yield break; } var aMap = AssigmentMap.Current; EPAssignmentRoute route = PXSelect <EPAssignmentRoute, Where <EPAssignmentRoute.assignmentMapID, Equal <Required <EPAssignmentRoute.assignmentMapID> > > > .Select(this, aMap.AssignmentMapID); if (route != null && aMap.EntityType != null) { Type graphType; if (aMap.GraphType != null) { graphType = GraphHelper.GetType(aMap.GraphType); } else { Type entityType = System.Web.Compilation.PXBuildManager.GetType(aMap.EntityType, false); graphType = EntityHelper.GetPrimaryGraphType(this, entityType); aMap.GraphType = graphType.FullName; } if (graphType != null) { PXSiteMapNode node = PXSiteMap.Provider.FindSiteMapNodeUnsecure(graphType); if (node != null) { yield return(new EntityItemSource(node, aMap.GraphType)); } } else { foreach (var e in EMailSourceHelper.TemplateScreens(this, null, null)) { yield return(e); } } } else { foreach (EntityItemSource e in EMailSourceHelper.TemplateScreensByCondition(this, null, null, type => type.IsDefined(typeof(PXEMailSourceAttribute), true) && typeof(PX.Data.EP.IAssign).IsAssignableFrom(type))) { if (!String.IsNullOrEmpty(e.ScreenID)) { PXSiteMapNode node = PXSiteMap.Provider.FindSiteMapNodeByScreenID(e.ScreenID); if (node != null && !String.IsNullOrEmpty(node.GraphType)) { e.SubKey = node.GraphType; yield return(e); } } } } }
protected virtual IEnumerable cacheTree( [PXString] string key ) { if (this.AssigmentMap.Current == null) { yield break; } foreach (var e in EMailSourceHelper.TemplateScreens(this, key, null)) { yield return(e); } }