public int CascadeChildDisplayTab(int revisingUser)
{
int count = 0;
foreach (DataRow itemRow in GetAllChildren(this.ItemId, RelationshipType.ItemToParentCategory.GetId(), this.PortalId).Tables[0].Rows)
{
Item childItem;
var itemId = (int)itemRow["itemId"];
if (GetItemTypeId(itemId) == ItemType.Article.GetId())
{
childItem = Article.GetArticle(itemId, this.PortalId, true, true, true);
}
else
{
childItem = GetCategory(itemId, true, true);
}
childItem.DisplayTabId = this.ChildDisplayTabId;
var childCategory = childItem as Category;
if (childCategory != null)
{
childCategory.ChildDisplayTabId = this.ChildDisplayTabId;
}
Setting displayOnCurrentPageSetting = Setting.ArticleSettingCurrentDisplay;
displayOnCurrentPageSetting.PropertyValue = false.ToString(CultureInfo.InvariantCulture);
childItem.VersionSettings.Add(new ItemVersionSetting(displayOnCurrentPageSetting));
childItem.Save(revisingUser);
count++;
}
return count;
}