Book a Demo

Author Topic: Trouble Importing VB.Net Code  (Read 3551 times)

dbumich

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • If !EA.IsWorking() Then Exclaim("Doh!")
    • View Profile
Trouble Importing VB.Net Code
« on: March 04, 2005, 12:15:01 pm »
I'm having a bit of trouble importing some code into EA from VB.NET. I'm running version 4.50.748, having recently upgraded from 4.50.744. (BTW, I really like some of the new features in build 748 -- esp. seeing the member signatures in the Operations dialogue!)

The piece of code that I'm trying to import is part of a strongly-typed dataset, built with Microsoft's xsd.exe auto-generation tool, and I've narrowed the guilty code section down to the following method:

------------------------------------------------------------------------
Friend Sub New(ByVal table As DataTable)
    MyBase.New(table.TableName)
    If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
         Me.CaseSensitive = table.CaseSensitive
    End If
    If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
         Me.Locale = table.Locale
    End If
    If (table.Namespace <> table.DataSet.Namespace) Then
         Me.Namespace = table.Namespace
    End If
    Me.Prefix = table.Prefix
    Me.MinimumCapacity = table.MinimumCapacity
    Me.DisplayExpression = table.DisplayExpression
End Sub
------------------------------------------------------------------------

If I take the previous code out of the class (which inherits the System.Data.DataTable class), then the class imports fine.

Also, if the code is left in, then the import process will not load any class located in the same .vb file as the code.

Finally, I also noticed that the import process has the same trouble with Delegates, as in the following:

------------------------------------------------------------------------
Public Delegate Sub GroupPriviledgeChangeEventHandler(ByVal sender As Object, ByVal e As GroupPriviledgeChangeEvent)
------------------------------------------------------------------------

Any advice as to how I can get around this problem? I can go ahead and comment out the necessary portions of code to import them, but I'm a lazy programmer -- I don't like extra steps like that!   ;)

dbumich

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • If !EA.IsWorking() Then Exclaim(&quot;Doh!&quot;)
    • View Profile
Re: Trouble Importing VB.Net Code
« Reply #1 on: March 04, 2005, 01:21:20 pm »
Quote
If (table.Namespace <> table.DataSet.Namespace) Then
     Me.Namespace = table.Namespace
End If

I found the guilty part of code. If the word "Namespace" appears anywhere in the code, then the import of the file fails -- unless it is used to define the namespace that the piece of code belongs to (ie. Namespace "SomeNamespace" .... End Namespace).

This is a problem, as the DataSet object defines a method called "Namespace" that subsequent code can access -- as in the code above.