當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。