~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/Scripting/Test/Utils/ConvertedFile.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using System.Text;
 
6
 
 
7
namespace ICSharpCode.Scripting.Tests.Utils
 
8
{
 
9
        /// <summary>
 
10
        /// Stores the filename and the code for the converted file.
 
11
        /// </summary>
 
12
        public class ConvertedFile 
 
13
        {
 
14
                public string FileName;
 
15
                public string Text;
 
16
                public Encoding Encoding;
 
17
                
 
18
                public ConvertedFile(string fileName, string text, Encoding encoding)
 
19
                {
 
20
                        this.FileName = fileName;
 
21
                        this.Text = text;
 
22
                        this.Encoding = encoding;
 
23
                }
 
24
                
 
25
                public override string ToString()
 
26
                {
 
27
                        return "FileName: " + FileName + "\r\n" +
 
28
                                "Encoding: " + Encoding + "\r\n" +
 
29
                                "Text: " + Text;
 
30
                }
 
31
                
 
32
                public override bool Equals(object obj)
 
33
                {
 
34
                        ConvertedFile convertedFile = obj as ConvertedFile;
 
35
                        if (convertedFile != null) {
 
36
                                return FileName == convertedFile.FileName && Text == convertedFile.Text && Encoding == convertedFile.Encoding;
 
37
                        }
 
38
                        return false;
 
39
                }
 
40
                
 
41
                public override int GetHashCode()
 
42
                {
 
43
                        return FileName.GetHashCode();
 
44
                }
 
45
        }
 
46
}