private void Translate(OeNavigationSelectItem parentNavigationItem, ExpandedNavigationSelectItem item) { IEdmEntitySetBase entitySet = OeEdmClrHelper.GetEntitySet(_edmModel, item); OeNavigationSelectItemKind kind; if (_notSelected) { kind = OeNavigationSelectItemKind.NotSelected; } else if (item.SelectAndExpand.IsNextLink()) { kind = OeNavigationSelectItemKind.NextLink; } else { kind = OeNavigationSelectItemKind.Normal; } var childNavigationSelectItem = new OeNavigationSelectItem(entitySet, parentNavigationItem, item, kind); childNavigationSelectItem = parentNavigationItem.AddOrGetNavigationItem(childNavigationSelectItem); if (childNavigationSelectItem.Kind == OeNavigationSelectItemKind.NextLink) { return; } foreach (SelectItem selectItemClause in item.SelectAndExpand.SelectedItems) { Translate(childNavigationSelectItem, selectItemClause); } }
private OeNavigationSelectItem AddOrGetNavigationItem(OeNavigationSelectItem parentNavigationItem, ExpandedNavigationSelectItem item, bool isExpand) { IEdmEntitySetBase entitySet = OeEdmClrHelper.GetEntitySet(_edmModel, item); OeNavigationSelectItemKind kind; if (_notSelected) { kind = OeNavigationSelectItemKind.NotSelected; } else if (item.SelectAndExpand.IsNextLink()) { kind = OeNavigationSelectItemKind.NextLink; } else { kind = OeNavigationSelectItemKind.Normal; } var childNavigationSelectItem = new OeNavigationSelectItem(entitySet, parentNavigationItem, item, kind); return(parentNavigationItem.AddOrGetNavigationItem(childNavigationSelectItem, isExpand)); }