当前位置: 首页>>代码示例>>C#>>正文


C# List.Union方法代码示例

本文整理汇总了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);

        }
开发者ID:mzaatar,项目名称:FreightForwarding,代码行数:29,代码来源:TranController_partial.cs

示例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);
    }
开发者ID:shengqh,项目名称:CQS.Core,代码行数:35,代码来源:MirnaUtils.cs

示例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);
        }
开发者ID:ninianne98,项目名称:CarrotCakeCMS-MVC,代码行数:31,代码来源:SiteExport.cs

示例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;
        }
开发者ID:julia-ford,项目名称:Contour-Tree-App,代码行数:13,代码来源:AbstractTree.cs

示例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;
 }
开发者ID:ggiraudon,项目名称:skype-history-reporter,代码行数:9,代码来源:SqliteChatRepository.cs

示例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;
        }
开发者ID:JonathanLydall,项目名称:Java-Transpiler-In-C-Sharp,代码行数:9,代码来源:DoWhileLoop.cs

示例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;
        }
开发者ID:JonathanLydall,项目名称:Java-Transpiler-In-C-Sharp,代码行数:9,代码来源:CatchStatement.cs

示例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;
        }
开发者ID:JonathanLydall,项目名称:Java-Transpiler-In-C-Sharp,代码行数:10,代码来源:VariableDeclaration.cs

示例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;
        }
开发者ID:adrianj,项目名称:AdriansLib,代码行数:11,代码来源:ObjectCollectionEditor.cs

示例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;
        }
开发者ID:JonathanLydall,项目名称:Java-Transpiler-In-C-Sharp,代码行数:14,代码来源:TryStatement.cs

示例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;
        }
开发者ID:JonathanLydall,项目名称:Java-Transpiler-In-C-Sharp,代码行数:15,代码来源:IfElseStatement.cs

示例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;
        }
开发者ID:JonathanLydall,项目名称:Java-Transpiler-In-C-Sharp,代码行数:15,代码来源:MethodDeclaration.cs

示例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;
        }
开发者ID:rsemenov,项目名称:PNets,代码行数:32,代码来源:TreeBuilderBase.cs

示例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();
 }
开发者ID:rabbal,项目名称:AspNetWebForms-Forum,代码行数:7,代码来源:Default.aspx.cs

示例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;
        }
开发者ID:sat1582,项目名称:CODEFramework,代码行数:16,代码来源:JavaScriptUtils.cs


注:本文中的List.Union方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。