Esempio n. 1
0
        public bool Close()
        {
            this.writer.Close();
            var memoryString = new IO.StreamReader(
                new IO.MemoryStream(this.stream.ToArray()), this.encoding).
                               ReadToEnd();
            string fileString = "";

            using (var file = new IO.FileStream(
                       this.filename, IO.FileMode.OpenOrCreate))
            {
                using (var fileReader = new IO.StreamReader(file))
                {
                    fileString = fileReader.ReadToEnd();
                }
            }
            if (memoryString != fileString)
            {
                using (var file = new IO.FileStream(this.filename, IO.FileMode.Create))
                {
                    using (var fileWriter = new IO.StreamWriter(file, this.encoding))
                    {
                        fileWriter.Write(memoryString);
                        file.SetLength(file.Position);
                    }
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
		public bool Close()
		{
			this.writer.Close();
			var memoryString = new IO.StreamReader(
					new IO.MemoryStream(this.stream.ToArray()), this.encoding).
				ReadToEnd();
			string fileString = "";
			using (var file = new IO.FileStream(
				this.filename, IO.FileMode.OpenOrCreate))
			{
				using (var fileReader = new IO.StreamReader(file))
				{
					fileString = fileReader.ReadToEnd();
				}
			}
			if (memoryString != fileString)
			{
				using (var file = new IO.FileStream(this.filename, IO.FileMode.Create))
				{
					using (var fileWriter = new IO.StreamWriter(file, this.encoding))
					{
						fileWriter.Write(memoryString);
						file.SetLength(file.Position);
					}
				}
				return true;
			}
			else
			{
				return false;
			}
		}
Esempio n. 3
0
 static string Revision()
 {
     using (var reader = new IO.StreamReader("../../../.svn/entries"))
     {
         reader.ReadLine();
         reader.ReadLine();
         reader.ReadLine();
         return(reader.ReadLine());
     }
 }
Esempio n. 4
0
 static string Revision()
 {
     using (var reader = new IO.StreamReader("../../../.svn/entries"))
     {
         reader.ReadLine();
         reader.ReadLine();
         reader.ReadLine();
         return reader.ReadLine();
     }
 }