Skip to content

Instantly share code, notes, and snippets.

@Vaccano
Created May 7, 2010 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vaccano/393510 to your computer and use it in GitHub Desktop.
Save Vaccano/393510 to your computer and use it in GitHub Desktop.
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