Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Convert between C# and Java with CSharpJavaMerger (http://www.go4expert.com/forums/convert-c-sharp-java-csharpjavamerger-t19474/)

sindy55 18Sep2009 13:49

Convert between C# and Java with CSharpJavaMerger
 
CSharpJavaMerger is an open source tool. It provides common interfaces of C# and Java and enables you to write one set of code which can be used both by C# and Java.

Below is a method that can be used in both of C# and Java. In the sample, CString is a class defined in the CSharpJavaMerger Framework.

Code:

public void AddTwoValues()
{
    try
    {
        CString strValue1 = m_mainForm.GetFirstTextBoxValue();
        CString strValue2 = m_mainForm.GetSecondTextBoxValue();

        int iValue1 = strValue1.ToInteger();
        int iValue2 = strValue2.ToInteger();
        int iResult = iValue1 + iValue2;
        CString strShowResult = CString.ValueOf(iResult);
        m_mainForm.ShowResult(strShowResult);
        CString strSaveResult = new CString(strValue1.GetValue() + " + " + strValue2.GetValue() + " = " + strShowResult.GetValue() + "\n");
        m_mainForm.SaveResult(strSaveResult);
    }
    catch (Exception ee)
    {
        m_mainForm.SaveResult(new CString(ee.Message + "\n"));
        m_mainForm.ShowResult(new CString("Error"));
    }
}

For more info on CSharpJavaMerger, you can visit kevingao.net.

shabbir 18Sep2009 18:53

Re: Convert between C# and Java with CSharpJavaMerger
 
Are you associated with CSharpJavaMerger. If thats the case G4EF can contribute to your Open Source project

sindy55 21Sep2009 08:37

Re: Convert between C# and Java with CSharpJavaMerger
 
Yes. Thanks for your interest, Shabbir.

You can join us by visiting kevingao.net, the C# & Java conversion serial. Also, you can find the CSharpJavaMerger project at codeplex.com.

Cheers.

shabbir 21Sep2009 18:54

Re: Convert between C# and Java with CSharpJavaMerger
 
I have already gone through them and read

http://www.go4expert.com/showthread.php?t=1211

and see if you satisfy majority of them. If you do we can donate some bucks your way


All times are GMT +5.5. The time now is 15:38.