SourceWriter.ViewController.SetLanguageFromPath C# (CSharp) Method

SetLanguageFromPath() public method

Attempts to set the syntax highlighting language based on the extension of the file being opened.
public SetLanguageFromPath ( string path ) : void
path string Path.
return void
		public void SetLanguageFromPath(string path) {

			// Save path
			FilePath = path;

			// Attempt to set the language based on the file
			// extension
			if (path.EndsWith (".cs")) {
				SetLanguageToCSharp ();
			} else if (path.EndsWith (".htm")) {
				SetLanguageToHTML ();
			} else if (path.EndsWith (".md")) {
				SetLanguageToMarkDown ();
			} else if (path.EndsWith (".xml")) {
				SetLanguageToXML ();
			}

		}