public bool ConvertSnippet(string TypeOfConversion, string SourceCode, out string ConvertedCode, out string ErrorMessage) { ErrorMessage = ConvertedCode = ""; bool result = CodeConversionHelpers.ConvertSnippet(TypeOfConversion, SourceCode, out ConvertedCode, out ErrorMessage); return(result); }
protected void convertCode_Click(object sender, EventArgs e) { string convertedSource = "", errorMessage = ""; string typeOfConversion = languageChoice.SelectedValue; string sourceCode = inputTextBox.Text.Trim(); bool result = CodeConversionHelpers.ConvertSnippet(typeOfConversion, sourceCode, out convertedSource, out errorMessage); if (result) { OutputLabel.Text = "Converted Sourcecode"; outputTextBox.Text = convertedSource; } else { OutputLabel.Text = "Conversion error, reason:"; outputTextBox.Text = errorMessage; } }