本文整理汇总了C#中InternalItem.TryGetTagValue方法的典型用法代码示例。如果您正苦于以下问题:C# InternalItem.TryGetTagValue方法的具体用法?C# InternalItem.TryGetTagValue怎么用?C# InternalItem.TryGetTagValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InternalItem
的用法示例。
在下文中一共展示了InternalItem.TryGetTagValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsRepositioningOfIndexItemRequired
/// <summary>
/// Determines whether repositioning of index item is required or not.
/// </summary>
/// <param name="indexInfo">The index info.</param>
/// <param name="addItem">The add item.</param>
/// <param name="internalItem">The internal item.</param>
/// <returns>
/// <c>true</c> if repositioning of index item is required; otherwise, <c>false</c>.
/// </returns>
private static bool IsRepositioningOfIndexItemRequired(Index indexInfo, IndexDataItem addItem, InternalItem internalItem)
{
byte[] sortTagValueInAddItem;
if (indexInfo.PrimarySortInfo.IsTag && addItem.Tags.TryGetValue(indexInfo.PrimarySortInfo.FieldName, out sortTagValueInAddItem))
{
// Index is sorted by tag and tag might have been updated
byte[] sortTagValueInIndex;
internalItem.TryGetTagValue(indexInfo.PrimarySortInfo.FieldName, out sortTagValueInIndex);
if (!ByteArrayComparerUtil.CompareByteArrays(sortTagValueInAddItem, sortTagValueInIndex))
{
return true;
}
}
return false;
}
示例2: ApplyFilterAndAddItem
/// <summary>
/// Applies the filter and adds the item.
/// </summary>
/// <param name="internalItem">The internal item.</param>
private void ApplyFilterAndAddItem(InternalItem internalItem)
{
if (InDeserializationContext.CapCondition != null &&
InDeserializationContext.CapCondition.FilterCaps != null &&
InDeserializationContext.CapCondition.FilterCaps.Count > 0)
{
#region CapCondition Exists
byte[] tagValue;
if (internalItem.TryGetTagValue(InDeserializationContext.CapCondition.FieldName, out tagValue))
{
#region Filter Cap found for tagValue
FilterCap filterCap;
if (InDeserializationContext.CapCondition.FilterCaps.TryGetValue(tagValue, out filterCap))
{
if (filterCap.Cap > 0 && FilterPassed(internalItem, GetCappedOrParentFilter(filterCap)))
{
filterCap.Cap--;
AddItem(internalItem, false);
}
}
#endregion
#region Filter Cap not found for tagValue
else if (FilterPassed(internalItem, InDeserializationContext.Filter))
{
AddItem(internalItem, false);
}
#endregion
}
#region Apply parent filter
else if (FilterPassed(internalItem, InDeserializationContext.Filter))
{
AddItem(internalItem, false);
}
#endregion
#endregion
}
#region CapCondition Doesn't Exist
else if (FilterPassed(internalItem, InDeserializationContext.Filter))
{
AddItem(internalItem, false);
}
#endregion
}