praticamente quello che non riesco a convertire :
codice:
public Main()
{
InitializeComponent();
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
using (AboutBox ab = new AboutBox())
ab.ShowDialog(this);
}
private void Main_Load(object sender, EventArgs e)
{
InitializeRAPI();
}
private void InitializeRAPI()
{
this.toolStripMenuItem1.Enabled = false;
this.m_rapi = new RAPI();
this.m_activeSync = this.m_rapi.ActiveSync;
this.m_activeSync.Disconnect += new DisconnectHandler(activeSync_Disconnect);
this.m_activeSync.Active += new ActiveHandler(activeSync_Active);
this.m_rapi.RAPIConnected += new RAPIConnectedHandler(rapi_RAPIConnected);
this.m_rapi.RAPIDisconnected += new RAPIConnectedHandler(rapi_RAPIDisconnected);
//Init rapi if the device is present
if (this.m_rapi.DevicePresent)
this.m_rapi.Connect();
}
private void rapi_RAPIConnected()
{
this.Invoke(
new MethodInvoker(
delegate()
{
this.Cursor = Cursors.WaitCursor;
this.Icon = Properties.Resources.Connected1;
this.toolStripStatusConnectionStatus.Image = Properties.Resources.Connected;
this.toolStripStatusConnectionStatus.Text = "Loading Directories...";
this.Refresh();
LoadDirectories("\\");
this.toolStripStatusConnectionStatus.Text = "Connected";
toolStripMenuItem1.Enabled = true;
this.Cursor = Cursors.Default;
}
)
);
}
private void rapi_RAPIDisconnected()
{
this.Invoke(
new MethodInvoker(
delegate()
{
this.Cursor = Cursors.WaitCursor;
this.Icon = Properties.Resources.Disconnected1;
this.toolStripStatusConnectionStatus.Image = Properties.Resources.Disconnected;
this.toolStripStatusConnectionStatus.Text = "Not Connected";
toolStripMenuItem1.Enabled = false;
this.Cursor = Cursors.Default;
}
)
);
}