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


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

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


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

示例1: WriteClientAssetsDebugMode

        public static void WriteClientAssetsDebugMode(HtmlDocument document, bool devMode, string bundleName = "/bundle.js")
        {
            var stylesheets = new[] {"bootstrap.min.css", "storyteller.css", "font-awesome.min.css", "fixed-data-table.min.css"};
            var tags = stylesheets.Select(file =>
            {
                var path = $"/public/stylesheets/{file}";
                return new HtmlTag("link").Attr("rel", "stylesheet").Attr("href", path);
            });

            document.Head.Append(tags);

            var bundleUrl = devMode ? "http://localhost:3001/client/public/javascript/bundle.js" : bundleName;
            var scriptTag = new HtmlTag("script").Attr("type", "text/javascript").Attr("src", bundleUrl);
            document.Body.Append(scriptTag);
        }
开发者ID:storyteller,项目名称:Storyteller,代码行数:15,代码来源:HomeEndpoint.cs

示例2: GetFileEncodingTest

        public void GetFileEncodingTest()
        {
            var testFiles = new[]
            {
                "utf8.yml",
                "utf8-explicit-bom.yml",
                "utf16be.yml",
                "utf16be-explicit-bom.yml",
                "utf16le.yml",
                "utf16le-explicit-bom.yml",
                "utf32be.yml",
                "utf32be-explicit-bom.yml",
                "utf32le.yml",
                "utf32le-explicit-bom.yml"
            };

            foreach (var fileName in testFiles.Select(f => string.Format(Path.Combine("..", "..", "TestData", f))))
                using (TextReader reader = new StreamReader(fileName, StringUtil.GetFileEncoding(fileName)))
                    Assert.AreEqual("test", reader.ReadLine());
        }
开发者ID:janno-p,项目名称:YamlSharp,代码行数:20,代码来源:StringUtilTest.cs

示例3: TextTokenTest

        public void TextTokenTest()
        {
            var tokens = new[]
                         {
                         	new Token( Parser._rule, "<%rule" ),
                         	null,
                         	new Token( Parser._ident, "Test" ),
                         	new Token( Parser._endStatement, "%>" ),
                         	new Token( Parser._end, "<%end%>" )
                         };
            var text = string.Join( "", tokens.Select( t => t != null ? t.value : " " ).ToArray() );
            var scanner = new global::WolfGenerator.Core.Parsing.Scanner( new MemoryStream( Encoding.UTF8.GetBytes( text ) ) );

            foreach (var expectedTokenValue in tokens.Where( s => s != null ))
            {
                var actualTokenValue = scanner.Scan();
                Assert.That( actualTokenValue.val, Is.EqualTo( expectedTokenValue.value ) );
                if (expectedTokenValue.type.HasValue)
                    Assert.That( actualTokenValue.kind, Is.EqualTo( expectedTokenValue.type.Value ),
                                 "Wrong kind of parsing token" );
            }
        }
开发者ID:werwolfby,项目名称:wolfgenerator,代码行数:22,代码来源:TokenUnitTest.cs

示例4: LoadShaderFromFile

        public static bool LoadShaderFromFile(int shaderObj, string fileName, string additionalDefines)
        {
            var compileStatus = 0;

            Sys.DebugLog(GL_LOG_FILENAME, "GL_Loading {0}", fileName);

            var version = "#version 150\n";

            try
            {
                if (!string.IsNullOrWhiteSpace(additionalDefines))
                {
                    var bufs = new[] {version, additionalDefines, File.ReadAllText(fileName)};
                    var lengths = bufs.Select(x => x.Length).ToArray();
                    GL.ShaderSource(shaderObj, 3, bufs, lengths);
                }
                else
                {
                    var bufs = new[] {version, File.ReadAllText(fileName)};
                    var lengths = bufs.Select(x => x.Length).ToArray();
                    GL.ShaderSource(shaderObj, 2, bufs, lengths);
                }
            }
            catch
            {
                return false;
            }

            Sys.DebugLog(GL_LOG_FILENAME, "Source loaded");
            GL.CompileShader(shaderObj);
            Sys.DebugLog(GL_LOG_FILENAME, "Trying to compile");
            GL.GetShader(shaderObj, ShaderParameter.CompileStatus, out compileStatus);
            PrintShaderInfoLog(shaderObj);

            if(compileStatus != 1)
            {
                Sys.DebugLog(GL_LOG_FILENAME, "Compilation failed");
                return false;
            }
            else
            {
                Sys.DebugLog(GL_LOG_FILENAME, "Compilation succeeded");
                return true;
            }
        }
开发者ID:zdimension,项目名称:FreeRaider,代码行数:45,代码来源:GLUtil.cs


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