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


C# SeekableStreamReader.Dispose方法代码示例

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


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

示例1: Parse

		void Parse (CompilationUnit file)
		{
			Stream input;

			try {
				input = File.OpenRead (file.Name);
			} catch {
				Report.Error (2001, "Source file `{0}' could not be found", file.Name);
				return;
			}

			SeekableStreamReader reader = new SeekableStreamReader (input, encoding);

			// Check 'MZ' header
			if (reader.Read () == 77 && reader.Read () == 90) {
				Report.Error (2015, "Source file `{0}' is a binary file and not a text file", file.Name);
				input.Close ();
				return;
			}

			reader.Position = 0;
			Parse (reader, file);
			reader.Dispose ();
			input.Close ();
		}	
开发者ID:Ein,项目名称:monodevelop,代码行数:25,代码来源:driver.cs

示例2: Parse

        void Parse(CompilationUnit file, ModuleContainer module)
        {
            Stream input;

            try {
                input = File.OpenRead (file.Name);
            } catch {
                Report.Error (2001, "Source file `{0}' could not be found", file.Name);
                return;
            }

            // Check 'MZ' header
            if (input.ReadByte () == 77 && input.ReadByte () == 90) {
                Report.Error (2015, "Source file `{0}' is a binary file and not a text file", file.Name);
                input.Close ();
                return;
            }

            input.Position = 0;
            SeekableStreamReader reader = new SeekableStreamReader (input, ctx.Settings.Encoding);

            Parse (reader, file, module);
            reader.Dispose ();
            input.Close ();
        }
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:25,代码来源:driver.cs

示例3: Parse

		public void Parse (SourceFile file, ModuleContainer module, ParserSession session, Report report)
		{
			Stream input;

			try {
				input = File.OpenRead (file.Name);
			} catch {
				report.Error (2001, "Source file `{0}' could not be found", file.Name);
				return;
			}

			// Check 'MZ' header
			if (input.ReadByte () == 77 && input.ReadByte () == 90) {

				report.Error (2015, "Source file `{0}' is a binary file and not a text file", file.Name);
				input.Close ();
				return;
			}

			input.Position = 0;
			SeekableStreamReader reader = new SeekableStreamReader (input, ctx.Settings.Encoding, session.StreamReaderBuffer);

			Parse (reader, file, module, session, report);

			if (ctx.Settings.GenerateDebugInfo && report.Errors == 0 && !file.HasChecksum) {
				input.Position = 0;
				var checksum = session.GetChecksumAlgorithm ();
				file.SetChecksum (checksum.ComputeHash (input));
			}

			reader.Dispose ();
			input.Close ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:33,代码来源:driver.cs


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