Message 1 of 3
OffsetInXref
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm failing at converting the Labs Plugin of the month OffsetInXref code to vb.net (http://labs.autodesk.com/utilities/ADN_plugins/updates/). I'm using one of the websites that converts c# to vb.net. Its/I'm having a problem converting the delagate from c# to vb.net. There is three locations where similar commands occur, but this code snippet is typical.
{code}
// When a document is created, make sure we handle the
// important events it fires
dm.DocumentCreated += delegate(object sender, DocumentCollectionEventArgs e)
{
e.Document.CommandWillStart +=
new CommandEventHandler(OnCommandWillStart);
e.Document.CommandEnded +=
new CommandEventHandler(OnCommandFinished);
e.Document.CommandCancelled +=
new CommandEventHandler(OnCommandFinished);
e.Document.CommandFailed +=
new CommandEventHandler(OnCommandFinished);
};
{code}
Here's the converted vb.net code which gives the errors in the first line.
{code}
' When a document is created, make sure we handle the
' important events it fires
dm.DocumentCreated += Function(ByVal sender As Object, ByVal e As DocumentCollectionEventArgs) Do
AddHandler e.Document.CommandWillStart, AddressOf OnCommandWillStart
AddHandler e.Document.CommandEnded, AddressOf OnCommandFinished
AddHandler e.Document.CommandCancelled, AddressOf OnCommandFinished
AddHandler e.Document.CommandFailed, AddressOf OnCommandFinished
End Function
{code}
Thanks
Christopher
{code}
// When a document is created, make sure we handle the
// important events it fires
dm.DocumentCreated += delegate(object sender, DocumentCollectionEventArgs e)
{
e.Document.CommandWillStart +=
new CommandEventHandler(OnCommandWillStart);
e.Document.CommandEnded +=
new CommandEventHandler(OnCommandFinished);
e.Document.CommandCancelled +=
new CommandEventHandler(OnCommandFinished);
e.Document.CommandFailed +=
new CommandEventHandler(OnCommandFinished);
};
{code}
Here's the converted vb.net code which gives the errors in the first line.
{code}
' When a document is created, make sure we handle the
' important events it fires
dm.DocumentCreated += Function(ByVal sender As Object, ByVal e As DocumentCollectionEventArgs) Do
AddHandler e.Document.CommandWillStart, AddressOf OnCommandWillStart
AddHandler e.Document.CommandEnded, AddressOf OnCommandFinished
AddHandler e.Document.CommandCancelled, AddressOf OnCommandFinished
AddHandler e.Document.CommandFailed, AddressOf OnCommandFinished
End Function
{code}
Thanks
Christopher
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
