本文整理汇总了C#中KeyValuePair.Except方法的典型用法代码示例。如果您正苦于以下问题:C# KeyValuePair.Except方法的具体用法?C# KeyValuePair.Except怎么用?C# KeyValuePair.Except使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyValuePair
的用法示例。
在下文中一共展示了KeyValuePair.Except方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RestoreSnapshot
public static Expression RestoreSnapshot(KeyValuePair<string, List<Type>>[] SnapshotData)
{
if (SnapshotData.SequenceEqual(CurrentScope.OnDateType)) return null;
var Ret = Expression.Block(
SnapshotData.Except(CurrentScope.OnDateType)
.SelectMany(x => x.Value.Select(y => CurrentScope.GetVarCached(x.Key, y)))
);
SnapshotData = null;
return Ret;
}
示例2: WriteConstants
private static void WriteConstants(StringBuilder outputString, HashSet<string> usedConstants, ref KeyValuePair<string,string>[] remainingConstants, string prefix, string constantsName = null, Func<string, bool> additionalAcceptanceConstantFilter = null, Func<string, bool> additionalRejectConstantFilter = null)
{
if (string.IsNullOrEmpty(constantsName))
constantsName = FormatEnumName(prefix, "");
var constants = remainingConstants.Where(k => (k.Key.StartsWith(prefix) || (additionalAcceptanceConstantFilter != null && additionalAcceptanceConstantFilter(k.Key))) && (additionalRejectConstantFilter == null || additionalRejectConstantFilter(k.Key))).ToArray();
remainingConstants = remainingConstants.Except(constants).ToArray();
outputString.AppendLine(" enum " + constantsName);
outputString.AppendLine(" {");
foreach (var c in constants)
{
string cname = FormatEnumName(c.Key, prefix);
while (usedConstants.Contains(cname))
cname += "_";
usedConstants.Add(cname);
outputString.AppendFormat(" {0} = {1},", cname, c.Value);
outputString.AppendLine();
}
outputString.AppendLine(" };");
}