Created
May 7, 2010 14:51
-
-
Save Vaccano/393510 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace TestApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Begin"); | |
var var1 = new MyClass("Name1","exe"); | |
var var2 = new MyClass("Name2", "txt"); | |
MyInterface var3 = var1; | |
var1.FileExtension = "pdf"; | |
Console.WriteLine(var1.FileExtension); | |
Console.WriteLine(var2.FileExtension); | |
Console.WriteLine(var3.FileExtension); | |
Console.ReadLine(); | |
} | |
} | |
public interface MyInterface | |
{ | |
String FileName { get; set; } | |
String FileExtension { get; set; } | |
} | |
public class MyClass: MyInterface | |
{ | |
public MyClass(string fileName, String fileExtension) | |
{ | |
_fileName = fileName; | |
_fileExtension = fileExtension; | |
} | |
private string _fileName; | |
private string _fileExtension; | |
public string FileName | |
{ | |
get { return _fileName; } | |
set { _fileName = value; } | |
} | |
public string FileExtension | |
{ | |
get { return _fileExtension; } | |
set { _fileExtension = value; } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment