private IEnumerable <TargetItem> CreateTargetsQueue(ConfigCode code, TargetItem target, IEnumerable <TargetHead> heads, IEnumerable <Tuple <TargetHead, TargetPart> > parts) { IEnumerable <ArticleTarget> targetList = new List <ArticleTarget>(); ConfigType targetType = ModelSourceProfile.GetConfigType(code); ConfigBind targetBind = ModelSourceProfile.GetConfigBind(code); TargetHead codeHead = 0; TargetPart codePart = 0; ConfigCode codeBody = code; TargetSeed seedBody = 0; if (targetBind == (ConfigBind)ArticleBind.ARTICLE_OPT) { return(targetList); } if (targetType == (ConfigType)ArticleType.NO_HEAD_PART_TYPE) { targetList = new List <ArticleTarget>() { new ArticleTarget(codeHead, codePart, codeBody, seedBody) }; } if (targetType == (ConfigType)ArticleType.HEAD_CODE_ARTICLE) { if (target.Head() != 0) { codeHead = target.Head(); targetList = new List <ArticleTarget>() { new ArticleTarget(codeHead, codePart, codeBody, seedBody) }; } else { targetList = heads.Select((ch) => (new ArticleTarget(ch, codePart, codeBody, seedBody))).ToList(); } } else if (targetType == (ConfigType)ArticleType.PART_CODE_ARTICLE) { if (target.Head() != 0 && target.Part() != 0) { codeHead = target.Head(); codePart = target.Part(); targetList = new List <ArticleTarget>() { new ArticleTarget(codeHead, codePart, codeBody, seedBody) }; } else { targetList = parts.Select((pp) => (new ArticleTarget(pp.Item1, pp.Item2, codeBody, seedBody))).ToList(); } } return(targetList); }
public TargetItem StoreGeneralItem(TargetItem target, ISourceValues tagsBody) { return(StoreGeneralItem(target.Head(), target.Part(), target.Code(), target.Seed(), tagsBody)); }