本文整理汇总了C#中List.Union方法的典型用法代码示例。如果您正苦于以下问题:C# List.Union方法的具体用法?C# List.Union怎么用?C# List.Union使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类List
的用法示例。
在下文中一共展示了List.Union方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPendingTrans
public ActionResult GetPendingTrans()
{
var WF = new BusinessLogic.FFWorkFlow();
IEnumerable<KeyValuePair<int, string>> trans = new List<KeyValuePair<int,string>>();
if (User.IsInRole("administrators") || User.IsInRole("sales"))
trans = trans.Union(WF.GetTranForSales());
if (User.IsInRole("administrators") || User.IsInRole("operation"))
trans = trans.Union(WF.GetTranForOperations());
if (User.IsInRole("administrators") || User.IsInRole("accounting"))
trans = trans.Union(WF.GetTranForAccounting());
if (User.IsInRole("administrators") || User.IsInRole("customersservice") || User.IsInRole("accounting"))
trans = trans.Union(WF.GetTranToBePaid());
if (User.IsInRole("administrators") || User.IsInRole("customersservice") || User.IsInRole("operation"))
trans = trans.Union(WF.GetTranETA());
if (trans == null)
{
return Json(null, JsonRequestBehavior.AllowGet);
}
return Json(trans, JsonRequestBehavior.AllowGet);
}
示例2: GetCombinedSequence
public static CombinedSequence GetCombinedSequence(string seq1, string seq2)
{
List<CombinedSequence> scores = new List<CombinedSequence>();
for (int i = 0; i < 3; i++)
{
List<int> vs = new List<int>();
for (int j = 0; j < i; j++)
{
vs.Add(j);
}
var subseq1 = seq1.Substring(i);
scores.Add(new CombinedSequence()
{
Sequence1 = seq1,
Sequence2 = seq2,
Position1 = i,
Position2 = 0,
MismatchPositions = vs.Union(GetMismatchIndecies(subseq1, seq2).ConvertAll(m => m + i)).ToArray()
});
var subseq2 = seq2.Substring(i);
scores.Add(new CombinedSequence()
{
Sequence1 = seq1,
Sequence2 = seq2,
Position1 = 0,
Position2 = i,
MismatchPositions = vs.Union(GetMismatchIndecies(seq1, subseq2).ConvertAll(m => m + i)).ToArray()
});
}
var min = scores.Min(m => m.MismatchPositions.Length);
return scores.Find(m => m.MismatchPositions.Length == min);
}
示例3: SiteExport
public SiteExport(Guid siteID, ExportType exportWhat)
{
SiteData s = null;
List<ContentPageExport> pages = new List<ContentPageExport>();
s = SiteData.GetSiteByID(siteID);
if (exportWhat == ExportType.AllData) {
pages = ContentImportExportUtils.ExportAllSiteContent(siteID);
} else {
if (exportWhat == ExportType.ContentData) {
List<ContentPageExport> lst = ContentImportExportUtils.ExportPages(siteID);
pages = pages.Union(lst).ToList();
}
if (exportWhat == ExportType.BlogData) {
List<ContentPageExport> lst = ContentImportExportUtils.ExportPosts(siteID);
pages = pages.Union(lst).ToList();
}
}
this.TheUsers = (from u in ExtendedUserData.GetUserList()
select new SiteExportUser {
Email = u.Email,
Login = u.UserName,
FirstName = u.FirstName,
LastName = u.LastName,
UserNickname = u.UserNickName
}).ToList();
SetVals(s, pages);
}
示例4: GetCritical
/// <summary>
/// Accessor for all of the critical nodes in the tree.
/// </summary>
/// <returns>a list of the critical nodes in the tree</returns>
public List<TreeNode> GetCritical()
{
List<TreeNode> list = new List<TreeNode>();
list = list.Union(this.parentless).ToList();
list = list.Union(this.childless ).ToList();
list = list.Union(this.merging ).ToList();
return list;
}
示例5: GetAlltimeChatMembers
public IEnumerable<Member> GetAlltimeChatMembers(Chat chat)
{
IEnumerable<string> participants = new List<string>();
participants = participants.Union(chat.Participants.Split(' '));
participants = participants.Union(chat.ActiveMembers.Split(' '));
participants = participants.Union(chat.Posters.Split(' '));
var members = LoadMembers(participants);
return members;
}
示例6: GetUsedTypes
public override IList<string> GetUsedTypes()
{
var returnList = new List<string>();
returnList = returnList.Union(GetUsedTypesFromAstNodes(Body)).ToList();
returnList = returnList.Union(GetUsedTypesFromAstNodes(Condition)).ToList();
return returnList;
}
示例7: GetUsedTypes
public override IList<string> GetUsedTypes()
{
var returnList = new List<string>();
returnList = returnList.Union(GetUsedTypesFromAstNodes(Body)).ToList();
returnList = returnList.Union(GetUsedTypesFromInputElements(ExceptionTypes)).ToList();
return returnList;
}
示例8: GetUsedTypes
public override IList<string> GetUsedTypes()
{
var returnList = new List<string>();
returnList = returnList.Union(GetUsedTypesFromAstNodes(AssignedValue)).ToList();
returnList = returnList.Union(GetUsedTypesFromInputElements(Modifiers)).ToList();
AddUsedTypeIfIdentifierToken(VariableType, returnList);
return returnList;
}
示例9: GetImplementingTypes
public static IEnumerable<Type> GetImplementingTypes(Type typeToImplement)
{
Assembly asm = Assembly.GetExecutingAssembly();
List<Type> ret = new List<Type>();
ret = ret.Union(GetImplementingTypesInAssembly(typeToImplement, asm)).ToList();
asm = Assembly.GetCallingAssembly();
if (asm != null)
ret = ret.Union(GetImplementingTypesInAssembly(typeToImplement, asm)).ToList();
return ret;
}
示例10: GetUsedTypes
public override IList<string> GetUsedTypes()
{
var returnList = new List<string>();
returnList = returnList.Union(GetUsedTypesFromAstNodes(TryBody)).ToList();
returnList = returnList.Union(GetUsedTypesFromAstNodes(FinallyBody)).ToList();
foreach (var catchStatement in CatchStatements)
{
returnList = returnList.Union(catchStatement.GetUsedTypes()).ToList();
}
return returnList;
}
示例11: GetUsedTypes
public override IList<string> GetUsedTypes()
{
var returnList = new List<string>();
returnList = returnList.Union(GetUsedTypesFromAstNodes(Condition)).ToList();
returnList = returnList.Union(GetUsedTypesFromAstNodes(Body)).ToList();
returnList = returnList.Union(GetUsedTypesFromAstNodes(ElseBody)).ToList();
foreach (var conditionalElse in ConditionalElses)
{
returnList = returnList.Union(conditionalElse.GetUsedTypes()).ToList();
}
return returnList;
}
示例12: GetUsedTypes
public override IList<string> GetUsedTypes()
{
var returnList = new List<string>();
foreach (var argument in Arguments)
{
returnList = returnList.Union(argument.GetUsedTypes()).ToList();
}
AddUsedTypeIfIdentifierToken(ReturnType, returnList);
returnList = returnList.Union(GetUsedTypesFromAstNodes(Body)).ToList();
AddUsedTypeIfIdentifierToken(ThrowsType, returnList);
return returnList;
}
示例13: GetAvailableTransitions
protected virtual List<int> GetAvailableTransitions(TreeNode node)
{
List<int> tSet = new List<int>();
for (int i = 0; i < node.Marking.rows; i++)
{
if (node.Marking[i] > 0)
{
tSet = tSet.Union(GetPostPSet(i, (int)node.Marking[i])).ToList();
}
}
List<int> tRes = new List<int>();
for (int i = 0; i < tSet.Count; i++)
{
bool available = true, dead = true;
for (int p = 0; p < PetriNet.PlacesCount; p++)
{
if (PetriNet.WeightMatrix[p, tSet[i]] != null &&
PetriNet.WeightMatrix[p, tSet[i]].PT > 0 && PetriNet.WeightMatrix[p, tSet[i]].PT > node.Marking[p])
{
available = false;
}
//if (PetriNet.WeightMatrix[p, tSet[i]] != null && PetriNet.WeightMatrix[p, tSet[i]].TP > 0)
//{
// dead = false;
//}
}
if (available )//&& !dead)
tRes.Add(tSet[i]);
}
return tRes;
}
示例14: GetLastTopicOfForum
private Entities.Models.ForumTopic GetLastTopicOfForum(long id)
{
var forum = _forumRepository.Get(id);
var topics = new List<Entities.Models.ForumTopic>();
forum.Children.ForEach(a => topics.AddRange(a.Topics));
return topics.Union(forum.Topics).OrderByDescending(a => a.CreateDate).FirstOrDefault();
}
示例15: JavaScriptUtils
static JavaScriptUtils()
{
IList<char> escapeChars = new List<char>
{
'\n', '\r', '\t', '\\', '\f', '\b',
};
for (var i = 0; i < ' '; i++)
escapeChars.Add((char) i);
foreach (var escapeChar in escapeChars.Union(new[] {'\''}))
SingleQuoteCharEscapeFlags[escapeChar] = true;
foreach (var escapeChar in escapeChars.Union(new[] {'"'}))
DoubleQuoteCharEscapeFlags[escapeChar] = true;
foreach (var escapeChar in escapeChars.Union(new[] {'"', '\'', '<', '>', '&'}))
HtmlCharEscapeFlags[escapeChar] = true;
}