public void PerformFormattingCommand(LanguageFormatCommand command) {
NSRange range = SelectedRange;
// Apply to start of line?
if (command.Postfix == "") {
// Yes, find start
range = Formatter.FindLineBoundries(TextStorage.Value, SelectedRange);
}
// Yes, get selected text
var location = range.Location;
var line = TextStorage.Value.Substring((int)range.Location, (int)range.Length);
// Apply command
var output = command.Prefix;
output += line;
output += command.Postfix;
TextStorage.BeginEditing ();
Replace(range, output);
TextStorage.EndEditing ();
Formatter.HighlightSyntaxRegion(TextStorage.Value, range);
}
#endregion