All Developers wants extra security and privacy for their code so that no hacker or competitor can have access to their code. CodePorting C#2Java provides the exact sort of security that any online application would offer. They use HTTPS with an extra layer of SSL and they also use powerful algorithm to avoid spyware or adware. With password protected Codeporting C#2Java subscription only you can access your code and no one else can see it.
In my previous post, I discussed about converting C# method names to java style using codeporting App and in this post I am going to feature another important aspect that is converting C# events to java. Events are integral parts of Windows form or Web Application and are also used in multitasking applications to control the flow and messages. Events allow classes or objects to interact with other classes of objects when something of their interest occurs. Event sender class is called publisher and the class that receives that event is called subscriber.
Following is an example of C# events to java conversion:
C# Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CsPorter.Examples.Convert.Events
{
class ExampleArgument
public delegate bool SomeDelegate(string resource);
public event SomeDelegate someEvent;
void Method1()
Method2(new SomeDelegate(someEvent));
Method2(someEvent);
}
void Method2(SomeDelegate dlg)
dlg("");
Java Code:
package CsPorter.Examples.Convert.Events;
// ********* THIS FILE IS AUTO PORTED FORM C# USING CODEPORTING.COM *********
import com.codeporting.csharp2java.java.Event;
public interface SomeDelegate{
boolean invoke(String resource);
private SomeDelegate someEventDelegate;
public final Event someEvent= new Event() {{
someEventDelegate = new SomeDelegate() {
public boolean invoke(String resource) {
return for (SomeDelegate delegate : invocationList) delegate.invoke(resource);
};
private void method1()
method2(someEventDelegate);
private void method2(SomeDelegate dlg)
dlg.invoke("");