Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# or autoit Pin
Curtis Schlak.26-Feb-09 8:32
Curtis Schlak.26-Feb-09 8:32 
QuestionHow to map DataGridView.Column.HeaderText to DataColumn.Caption property. Pin
hdv21226-Feb-09 5:52
hdv21226-Feb-09 5:52 
QuestionFlow Options opinions Pin
ffowler26-Feb-09 5:51
ffowler26-Feb-09 5:51 
AnswerRe: Flow Options opinions Pin
Ennis Ray Lynch, Jr.26-Feb-09 7:05
Ennis Ray Lynch, Jr.26-Feb-09 7:05 
GeneralRe: Flow Options opinions Pin
ffowler26-Feb-09 7:15
ffowler26-Feb-09 7:15 
GeneralRe: Flow Options opinions Pin
Ennis Ray Lynch, Jr.26-Feb-09 7:18
Ennis Ray Lynch, Jr.26-Feb-09 7:18 
GeneralRe: Flow Options opinions Pin
ffowler26-Feb-09 7:20
ffowler26-Feb-09 7:20 
QuestionCan you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Steve Holdorf26-Feb-09 5:48
Steve Holdorf26-Feb-09 5:48 
This may sound dumb but I will try anyway. I am trying to pass a delegate with variable parameters (params object[] {"1", "2"}) as a parameter to another delegate. What I am trying is below but it won't compile:

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            TestManager tManager = new TestManager();

            int iRet = tManager.TestMethod1(tManager.TestMethod5 (new List<string> {"2", "1"} ));

            Console.WriteLine("Result: " + iRet.ToString());

            Console.ReadLine();

        }
    }
}

namespace ConsoleApplication1
{
    delegate object TestDelegate (params object[] list);
    delegate object ContaineOne (TestDelegate test);

    class TestManager
    {
        public int TestMethod1(ContaineOne TestMethod3)
        {
            TestDelegate td = new TestDelegate();

            td = TestMethod3.Method;
 
            int iRet = (1 + td(list));

            return iRet;
        }
        
        public int TestMethod5(params object[] list)
        {
            return Convert.ToInt32(list["zero"]);
        }
    }

}

</string>


Anyway, if you think I am an dumb and this can't be done please let me know.

Thanks,


Steve
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Steve Holdorf26-Feb-09 6:36
Steve Holdorf26-Feb-09 6:36 
AnswerRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? [modified] Pin
Steve Holdorf26-Feb-09 7:57
Steve Holdorf26-Feb-09 7:57 
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Alan N26-Feb-09 9:30
Alan N26-Feb-09 9:30 
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Steve Holdorf26-Feb-09 10:11
Steve Holdorf26-Feb-09 10:11 
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Steve Holdorf26-Feb-09 12:18
Steve Holdorf26-Feb-09 12:18 
AnswerRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Ennis Ray Lynch, Jr.26-Feb-09 7:02
Ennis Ray Lynch, Jr.26-Feb-09 7:02 
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
led mike26-Feb-09 7:07
led mike26-Feb-09 7:07 
AnswerRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Luc Pattyn26-Feb-09 8:02
sitebuilderLuc Pattyn26-Feb-09 8:02 
GeneralRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Steve Holdorf26-Feb-09 8:20
Steve Holdorf26-Feb-09 8:20 
AnswerRe: Can you pass a delegate that contains params object[] parameters to another degelate as a parameter? Pin
Luc Pattyn26-Feb-09 8:38
sitebuilderLuc Pattyn26-Feb-09 8:38 
Questionhow to apply zoom to usercontrol... Pin
priyareguri26-Feb-09 5:10
priyareguri26-Feb-09 5:10 
AnswerRe: how to apply zoom to usercontrol... [modified] Pin
Calin Tatar26-Feb-09 5:25
Calin Tatar26-Feb-09 5:25 
GeneralRe: how to apply zoom to usercontrol... Pin
priyareguri27-Feb-09 4:43
priyareguri27-Feb-09 4:43 
QuestionCrystal report question Pin
E_Gold26-Feb-09 3:56
E_Gold26-Feb-09 3:56 
AnswerRe: Crystal report question Pin
led mike26-Feb-09 4:37
led mike26-Feb-09 4:37 
AnswerRe: Crystal report question Pin
DaveyM6926-Feb-09 4:51
professionalDaveyM6926-Feb-09 4:51 
GeneralRe: Crystal report question Pin
E_Gold26-Feb-09 11:04
E_Gold26-Feb-09 11:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.