According to Wikipedia XSLT (Extensible Stylesheet Language Transformations) is a language for transforming XML documents into other XML documents, or other objects such as HTML for web pages, plain text or into XSL Formatting Objects which can then be converted to PDF, PostScript and PNG.

To test my application I added XML and one XSL file which I actually copied from here, since I was too lazy to write one on my own. After adding those two files, right click on them, and click properties:

Then change property "Copy to Output Directory" of those files to "Copy Always", otherwise application will not find them:

Source code is simple: 

namespace xslTransform
{
  using System.Diagnostics;
  using System.IO;
  using System.Xml;
  using System.Xml.XPath;
  using System.Xml.Xsl;

  class Program
  {
    static void Main(string[] args)
    {
      XslCompiledTransform xslt = new XslCompiledTransform();

      xslt.Load("myXslt.xsl");

      using (FileStream fs = new FileStream("cdCatalog.html", FileMode.Create))
      {
        XmlTextWriter writer = new XmlTextWriter(fs, null) { Formatting = Formatting.Indented };

        xslt.Transform(new XPathDocument("cdCatalog.xml"), null, writer);
      }

      Process.Start("cdCatalog.html");
    }
  }
}

Here notice line:

Process.Start("cdCatalog.html"); 

with that line I opened default btrowser.

Two lines are important:

xslt.Load("myXslt.xsl"); - to load transformation
xslt.Transform(new XPathDocument("cdCatalog.xml"), null, writer); - to apply transformation

Source code you can download from here.

Code to write this article I have stolen from here.

Code looks like this: 

  class Program
  {
    static void Main(string[] args)
    {
      MyEvents me = new MyEvents();
      Listener l = new Listener();
      l.Subscribe(me);
      me.Start();
    }
  }

  public class MyEvents
  {
    public event MyEventHandler MyEvent;
    public EventArgs e = null;
    public delegate void MyEventHandler(object sender, EventArgs e);

    public void Start()
    {
      while (true)
      {
        System.Threading.Thread.Sleep(3000);
        if (MyEvent != null)
        {
          MyEvent(this, e);
        }
      }
    }
  }

  public class Listener
  {
    public EventArgs e = null;
    public void Subscribe(MyEvents m)
    {
      m.MyEvent += new MyEvents.MyEventHandler(HeardIt);
    }

    private void HeardIt(object sender, EventArgs e)
    {
      System.Console.WriteLine("Test");
    }
  }

Now, lets try to analyze it part by part.

If we start from beginning, you will see code like: 

static void Main(string[] args)
{
	MyEvents me = new MyEvents();
	Listener l = new Listener();
	l.Subscribe(me);
	me.Start();
}

Then in events class notice that we had to define delegate like:

public delegate void MyEventHandler(object sender, EventArgs e);

Our event will then use delegate like:

public event MyEventHandler MyEvent;

And we called our event (delegate) method like:

MyEvent(this, e);

In this moment application still has no idea about MyEvents implementation.

We have to define "Listener" which will listen our event, and with that, we will actually implement our delegate.

First we have to "subscribe" to an event, like:

m.MyEvent += new MyEvents.MyEventHandler(HeardIt);

And finally implementation:

private void HeardIt(object sender, EventArgs e)
{
	System.Console.WriteLine("Test");
}

Example project you can download from here.

Just as a note to my self, here I showed one way of getting exe path, another way can be something like this:

Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Afile.xml")

So, with line:

Assembly.GetExecutingAssembly().Location

we are receiving full path, then with line:

Path.GetDirectoryName(...)

we are getting just a folder name, and with line:

Path.Combine(...)

we are combining path with our file name.

I was playing little bit with classes. Idea is to see how it will behave if we declare method with type as current class instance to which this method belong.

So, I have declared class like:

public class MyClass
{
	public string mOne = "none";
	public string mTwo = "none";
	public string mAll = "none";

	public MyClass MyMethodOne()
	{
		this.mOne = "I am from method one";
		this.mAll = "My name is all and I am also from method one";
		return this;
	}

	public MyClass MyMethodTwo()
	{
		this.mTwo = "I am from method two";
		this.mAll = "My name is all and I am also from method two";

		return this;
	}

	public MyClass MyMethodNewInstanceOne()
	{
		MyClass something = new MyClass();

		something.mOne = "I am from method one";
		something.mAll = "My name is all and I am also from method one";
		return this;
	}

	public MyClass MyMethodNewInstanceTwo()
	{
		MyClass something = new MyClass();

		something.mTwo = "I am from method two";
		something.mAll = "My name is all and I am also from method two";

		return something;
	}

}

Notice for example:

this.mTwo = "I am from method two";
return this;

Here we are not creating new instance, so if we do call like:

MyClass myClassesResult = playingWithClasses.MyMethodOne().MyMethodTwo();

We will not loose any changes

That means that if we create console application like:

MyClass playingWithClasses = new MyClass();
MyClass myClassesResult = playingWithClasses.MyMethodOne().MyMethodTwo();
Console.WriteLine("************* without new instance *************");

Console.WriteLine("One: " + myClassesResult.mOne);
Console.WriteLine("Two: " + myClassesResult.mTwo);
Console.WriteLine("All: " + myClassesResult.mAll);

Result will be like:

************* without new instance *************
One: I am from method one
Two: I am from method two
All: My name is all and I am also from method two

Then notice for example:

MyClass something = new MyClass();
something.mTwo = "I am from method two";
return something;

That means that if we create console application like:

MyClass playingWithClasses = new MyClass();
MyClass myClassesNewInstanceResult = playingWithClasses.MyMethodNewInstanceOne().MyMethodNewInstanceTwo();

Console.WriteLine("************* with new instance *************");

Console.WriteLine("One: " + myClassesNewInstanceResult.mOne);
Console.WriteLine("Two: " + myClassesNewInstanceResult.mTwo);
Console.WriteLine("All: " + myClassesNewInstanceResult.mAll);

Result will be like:

************* with new instance *************
One: none
Two: I am from method two
All: My name is all and I am also from method two

Example project you can download from here.