I was write a class on VB.NET and i wanna move my project on C#.NET. I know VB.NET class can be converted to DLL.
I also do that but i have a problem with just one line code :
On the class i wrote a code like this :
MyProject.Forms.frmMain.ComboBox1.Items.Add(modKb. Items(i).Name)
More Details :
Expand|Select|Wrap|Line Numbers
- Public Class modLay
- Public Shared Function Add() As Boolean
- Dim flag As Boolean
- Dim directory As String = (myFunctions.VerifyPath(MyProject.Application.Info.DirectoryPath) & "Items")
- If Not MyProject.Computer.FileSystem.DirectoryExists(directory) Then
- Interaction.MsgBox("'Layouts' folder not found", MsgBoxStyle.Critical, Nothing)
- ProjectData.EndApp()
- End If
- Dim onlys As ReadOnlyCollection(Of String) = MyProject.Computer.FileSystem.GetFiles(directory, SearchOption.SearchAllSubDirectories, New String() {"*.xml"})
- If (onlys.Count = 0) Then
- Interaction.MsgBox("No file found under 'Items' folder", MsgBoxStyle.Critical, Nothing)
- ProjectData.EndApp()
- End If
- modKB.LayNumber = (onlys.Count + 1)
- modKB.Lay = New clsLayouts(((modKB.LayNumber - 2) + 1) - 1) {}
- Dim num2 As Integer = (modKB.LayNumber - 2)
- Dim i As Integer = 0
- Do While (i <= num2)
- modKB.Lay(i) = New clsLayouts
- modKB.Lay(i).Init(onlys.Item(i))
- modKB.Lay(i).Path = onlys.Item(i)
- MyProject.Forms.frmMain.ComboBox1.Items.Add(modKB.Lay(i).Name)
- Catch exception1 As Exception
- ProjectData.SetProjectError(exception1)
- Dim exception As Exception = exception1
- ProjectData.ClearProjectError()
- End Try
- modKB.Lay(i).ID = i
- item.Tag = (i + 2)
- i += 1
- Loop
- Return flag
- End Function
Now my question is :
How to i call this code"genCombo.Items(i).Name" from dll (When i using that dll on C#.NET) ?
I can call the function but how to add item on C#.NET project ?