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


C# System.IO.Any方法代码示例

本文整理汇总了C#中System.IO.Any方法的典型用法代码示例。如果您正苦于以下问题:C# System.IO.Any方法的具体用法?C# System.IO.Any怎么用?C# System.IO.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO的用法示例。


在下文中一共展示了System.IO.Any方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsSatisifedBy

 public bool IsSatisifedBy(string path)
 {
     var fileExt = Path.GetExtension(path);
     var extensions = new[] { "PNG", "PCX", "JPG", "JPEG", "GIF", "TIF", "BMP", "TGA", };
     if (fileExt != null && fileExt != "") fileExt = fileExt.Substring(1).ToUpper();
     return extensions.Any(extension => fileExt != null && fileExt.Equals(extension));
 }
开发者ID:bsimser,项目名称:goldbox,代码行数:7,代码来源:ImagePlugin.cs

示例2: IsSatisifedBy

 public bool IsSatisifedBy(string path)
 {
     var nonImageDaxFiles = new [] { "WALLDEF", "MON", "ITEM", "MUSIC", "SOUND", "ZOUNDS", "LUCK" };
     var fileName = Path.GetFileName(path);
     if (fileName == null) return false;
     fileName = fileName.ToUpper();
     return !nonImageDaxFiles.Any(prefix => fileName.StartsWith(prefix)) && fileName.ToUpper().EndsWith(".DAX");
 }
开发者ID:bsimser,项目名称:goldbox,代码行数:8,代码来源:DaxImagePlugin.cs

示例3: IsOnBlackList

        static bool IsOnBlackList(string file)
        {
            var blackList = new[]
            {
                "signrequest-get-vanilla-query-unreserved",
                "signrequest-post-vanilla-query-nonunreserved",
                "signrequest-date-header-should-be-signed-headers",
                "signrequest-support-custom-config" // 2x // TODO what are these?
            };

            return blackList.Any(file.Contains);
        }
开发者ID:tt0th,项目名称:escher-csharp,代码行数:12,代码来源:AuthHeaderComposerTests.cs

示例4: IsVersionInsertPresent

        // ReSharper disable UnusedParameter.Local
        /// <summary>
        /// Checks if script makes insert into version history table
        /// </summary>
        public static bool IsVersionInsertPresent(DbVersion dbVersion, string script)
        {
            var versionInsertRegexes =
            new[] {
              string.Format("insert\\s+(into)?\\s+\\[?version(history)?\\]?(.+?){0}\\.{1}{2}{3}", dbVersion.Major, dbVersion.Minor, RevisionRegex(dbVersion), BuildRegex(dbVersion)),
              string.Format("insert\\s+into\\s+#temp(.+?)VALUES(.*?){0}\\.{1}{2}{3}", dbVersion.Major, dbVersion.Minor, RevisionRegex(dbVersion), BuildRegex(dbVersion)),
              "(alter|create)\\s+procedure\\s+(\\[?init\\]?\\.)?\\[?(init)?version\\]?",
            }
              .Select(pattern => new Regex(pattern, RegexOptions.IgnoreCase));

              return versionInsertRegexes.Any(r => r.IsMatch(script));
        }
开发者ID:spawluk,项目名称:UberDeployer,代码行数:16,代码来源:DbScriptToRun.cs

示例5: Method

        public int Method()
        {
            var variable = new[] { 1, 2, 3 };

            for (var i = 0; i < variable.Length; i++)
            {
                variable[i] *= variable[i];
            }

            return variable.Any()
                ? variable.Last()
                : default(int);
        }
开发者ID:creativejar,项目名称:development,代码行数:13,代码来源:Formatting.cs

示例6: CreateAlpsGaTspSample

 private AlpsGeneticAlgorithm CreateAlpsGaTspSample() {
   AlpsGeneticAlgorithm alpsGa = new AlpsGeneticAlgorithm();
   #region Problem Configuration
   var provider = new TSPLIBTSPInstanceProvider();
   var instance = provider.GetDataDescriptors().Single(x => x.Name == "ch130");
   TravelingSalesmanProblem tspProblem = new TravelingSalesmanProblem();
   tspProblem.Load(provider.LoadData(instance));
   tspProblem.UseDistanceMatrix.Value = true;
   #endregion
   #region Algorithm Configuration
   alpsGa.Name = "ALPS Genetic Algorithm - TSP";
   alpsGa.Description = "An age-layered population structure genetic algorithm which solves the \"ch130\" traveling salesman problem (imported from TSPLIB)";
   alpsGa.Problem = tspProblem;
   SamplesUtils.ConfigureAlpsGeneticAlgorithmParameters<GeneralizedRankSelector, MultiPermutationCrossover, InversionManipulator>(alpsGa,
     numberOfLayers: 1000,
     popSize: 100,
     mutationRate: 0.05,
     elites: 1,
     plusSelection: true,
     agingScheme: AgingScheme.Polynomial,
     ageGap: 20,
     ageInheritance: 1.0,
     maxGens: 1000);
   var checkedCrossovers = new[] { typeof(EdgeRecombinationCrossover), typeof(MaximalPreservativeCrossover), typeof(OrderCrossover2) };
   var multiCrossover = (MultiPermutationCrossover)alpsGa.Crossover;
   var crossovers = multiCrossover.Operators.Where(c => checkedCrossovers.Any(cc => cc.IsInstanceOfType(c))).ToList();
   foreach (var c in multiCrossover.Operators)
     multiCrossover.Operators.SetItemCheckedState(c, crossovers.Contains(c));
   #endregion
   return alpsGa;
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:31,代码来源:AlpsSampleTest.cs


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