本文整理汇总了C#中IData.IsTranslatable方法的典型用法代码示例。如果您正苦于以下问题:C# IData.IsTranslatable方法的具体用法?C# IData.IsTranslatable怎么用?C# IData.IsTranslatable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IData
的用法示例。
在下文中一共展示了IData.IsTranslatable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildElement
private Element BuildElement(IData data,
DynamicValuesHelperReplaceContext replaceContext,
TreeNodeDynamicContext dynamicContext,
bool localizationEnabled,
List<object> itemKeys,
ref IEnumerable<object> keysJoinedByParentFilters,
EntityToken parentEntityToken
)
{
replaceContext.CurrentDataItem = data;
object keyValue = this.KeyPropertyInfo.GetValue(data, null);
bool itemLocalizationEnabledAndForeign = localizationEnabled && !data.DataSourceId.LocaleScope.Equals(UserSettings.ActiveLocaleCultureInfo);
if (itemLocalizationEnabledAndForeign && itemKeys.Contains(keyValue)) return null;
var currentEntityToken = data.GetDataEntityToken();
var element = new Element(new ElementHandle
(
dynamicContext.ElementProviderName,
currentEntityToken,
dynamicContext.Piggybag.PreparePiggybag(this.ParentNode, parentEntityToken)
));
bool hasChildren;
bool isDisabled = false;
ResourceHandle icon, openedIcon;
if (itemLocalizationEnabledAndForeign)
{
hasChildren = false;
isDisabled = !data.IsTranslatable();
if (this.Icon != null)
{
icon = this.Icon;
openedIcon = this.OpenedIcon;
}
else
{
icon = data.GetForeignIcon();
openedIcon = icon;
}
}
else
{
if (this.Display != LeafDisplayMode.Auto)
{
hasChildren = ChildNodes.Any();
}
else
{
hasChildren = ChildNodes.OfType<SimpleElementTreeNode>().Any();
if (!hasChildren)
{
if (keysJoinedByParentFilters != null)
{
keysJoinedByParentFilters = keysJoinedByParentFilters.Evaluate();
hasChildren = keysJoinedByParentFilters.Contains(keyValue);
}
}
// Checking children filtered by FunctionFilters
if (!hasChildren)
{
foreach (var childNode in this.ChildNodes.OfType<DataElementsTreeNode>()
.Where(n => n.FilterNodes.OfType<FunctionFilterNode>().Any()))
{
var newDynamicContext = new TreeNodeDynamicContext(TreeNodeDynamicContextDirection.Down)
{
ElementProviderName = dynamicContext.ElementProviderName,
Piggybag = dynamicContext.Piggybag.PreparePiggybag(this.ParentNode, parentEntityToken),
CurrentEntityToken = currentEntityToken
};
if (childNode.GetDataset(newDynamicContext, false).DataItems.Any())
{
hasChildren = true;
break;
}
}
}
}
if (this.Icon != null)
{
icon = this.Icon;
openedIcon = this.OpenedIcon;
}
else
{
openedIcon = icon = data.GetIcon();
}
}
//.........这里部分代码省略.........