|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SampleDll
{
public class Calc
{
public int Add(int x, int y)
{
return x + y;
}
public int Subtract(int x, int y)
{
return x - y;
}
public int Multiply(int x, int y)
{
return x * y;
}
public int DivideBy(int x, int y)
{
return x / y;
}
public double ShowPI()
{
return 3.14;
}
public override string ToString()
{
return "A Calc";
}
}
public class Person
{
private string sampleField = string.Empty;
public string LastName { get; set; }
public string FirstName { get; set; }
public int ID { get; set; }
public Person()
{
FirstName = string.Empty;
LastName = string.Empty;
ID = 0;
}
public Person(int id,string firstName,string lastName):this(firstName,lastName)
{
ID = id;
}
public Person(string firstName, string lastName)
{
FirstName = firstName;
LastName = lastName;
}
public override string ToString()
{
return "A Person";
}
public string ShowData()
{
StringBuilder sb=new StringBuilder();
sb.AppendFormat("ID: {0}, FirstName: {1}, LastName: {2}", ID, FirstName, LastName);
return sb.ToString();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm a software engineer specialized in .NET framework. I've developed applications in such technologies as Console Applications, Windows Forms, WPF, Web Forms, MVC, Silverlight and Xamarin Forms. I also create and publish my multimedia courses at provid.ir and softdevwithmorteza.wordpress.com.
Some of my courses inclue Design Patterns in C#, OOP Principles, SOLID Principles, High Quality Coding Principles, Anti-patterns, Refactoring, TDD, DDD, .NET Core and so on.