Ejemplo 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);
            }
        }
Ejemplo 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;
			}
		}
Ejemplo n.º 3
0
 static string Revision()
 {
     using (var reader = new IO.StreamReader("../../../.svn/entries"))
     {
         reader.ReadLine();
         reader.ReadLine();
         reader.ReadLine();
         return(reader.ReadLine());
     }
 }
Ejemplo n.º 4
0
 static string Revision()
 {
     using (var reader = new IO.StreamReader("../../../.svn/entries"))
     {
         reader.ReadLine();
         reader.ReadLine();
         reader.ReadLine();
         return reader.ReadLine();
     }
 }