예제 #1
0
    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);
    }
예제 #2
0
    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;
        }
    }