C# Question....

Cableguy

Expert
Licensed User
Longtime User
I am trying to build a wrapper for a DLL I found... AN now I have an issue...
I have a (?)method(?) that can only be called once...
But I need to callet it several times...

The c# code line is something like this:

WorksheetRow Linha = Sheet.Table.Rows.Add();

The RED color parts are part of the DLL namespace for wich I am wrapping....
But this method only accepts being called more than once if I change the method's name, ex :Linha1, Linha2,etc...
This is something that is just not viable...
So, is there a way to Dynamically change this "Linha" to something Like "Linha"& n, being n an integer incremented upon the call of this public sub??

My current public call looks like this:

public void InsertTextToCell( int Col, int Row, string Text)

I am willing to add a string Name param, to name the method, but do I acomplish that?
 
Last edited:

agraham

Expert
Licensed User
Longtime User
I need to see a bit more code/information to see why you need multiple WorksheetRows and what you want to do with them. My best guess is that you need to add them to a Collection of some sort as the set of rows represents the contents of the worksheet.

EDIT :- If you don't actually need the return don't do the assignment or if you do do it to a pre-declared WorksheetRow instance.
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
I'm sending my SharpDev proj to you by email!

SENT!
 
Last edited:
Top