Click here to Skip to main content
15,902,860 members
Home / Discussions / C#
   

C#

 
AnswerRe: Order execution sequence Pin
YENSIX8-Jan-13 11:17
YENSIX8-Jan-13 11:17 
GeneralRe: Order execution sequence Pin
vanikanc8-Jan-13 14:36
vanikanc8-Jan-13 14:36 
GeneralRe: Order execution sequence Pin
vanikanc9-Jan-13 5:24
vanikanc9-Jan-13 5:24 
GeneralRe: Order execution sequence Pin
Pete O'Hanlon9-Jan-13 5:28
mvePete O'Hanlon9-Jan-13 5:28 
GeneralRe: Order execution sequence Pin
vanikanc9-Jan-13 9:41
vanikanc9-Jan-13 9:41 
GeneralRe: Order execution sequence Pin
YENSIX10-Jan-13 10:56
YENSIX10-Jan-13 10:56 
GeneralRe: Order execution sequence Pin
vanikanc14-Jan-13 9:45
vanikanc14-Jan-13 9:45 
QuestionCalling Console project Pin
PozzaVecia8-Jan-13 9:08
PozzaVecia8-Jan-13 9:08 
Suppose that I have a solution with many console projects, let's say P1, P2, P3. You can run each of them individually. Moreover I have a project named MENU (StartUp project), running it I'm able to call each projects of my solution (so P1, P2,P3). Each project is a console project with many static methods (so for project P1 I have P1M1, P1M2,...). Each project has an entry point Main(). Running each single project (for example P1) individually, I show a menu where I can run separately each methods of the project class (for example P1M1, P1M2,..).

The user can use the solution in two ways:
1)
Select a single project (set as StartUp), run it, for example P1. The Main() will start a menu where the user can chose a method( P1M1,P1M2,..)
2)
Run the MENU project, which call a project, then select a method.

How can I call a method P1M1 of project P1 from project MENU:

I used in the MENU project:
C#
 ProcessStartInfo start = new ProcessStartInfo();
start.FileName("P1.exe")
Process p = new Process();
p.StartInfo = start;
p.Start();
P.WaitForExit();


But in this way it call the Main(), but I want to call the method P1M1 in the P1 class.
A working solution is to make the Main of P1 with args (Main(string[] args)) and using a switch inside calling each method, but I wonder if is there a smarter solution?
AnswerRe: Calling Console project Pin
PIEBALDconsult8-Jan-13 9:17
mvePIEBALDconsult8-Jan-13 9:17 
GeneralRe: Calling Console project Pin
SledgeHammer018-Jan-13 9:31
SledgeHammer018-Jan-13 9:31 
GeneralRe: Calling Console project Pin
PIEBALDconsult8-Jan-13 11:05
mvePIEBALDconsult8-Jan-13 11:05 
AnswerRe: Calling Console project Pin
PozzaVecia8-Jan-13 9:23
PozzaVecia8-Jan-13 9:23 
GeneralRe: Calling Console project Pin
SledgeHammer018-Jan-13 9:31
SledgeHammer018-Jan-13 9:31 
GeneralRe: Calling Console project Pin
PIEBALDconsult17-Jan-13 12:45
mvePIEBALDconsult17-Jan-13 12:45 
GeneralRe: Calling Console project Pin
Dave Kreskowiak8-Jan-13 9:44
mveDave Kreskowiak8-Jan-13 9:44 
GeneralRe: Calling Console project Pin
PozzaVecia8-Jan-13 10:41
PozzaVecia8-Jan-13 10:41 
GeneralRe: Calling Console project Pin
Pete O'Hanlon8-Jan-13 11:28
mvePete O'Hanlon8-Jan-13 11:28 
GeneralRe: Calling Console project Pin
Dave Kreskowiak8-Jan-13 12:41
mveDave Kreskowiak8-Jan-13 12:41 
GeneralRe: Calling Console project Pin
PIEBALDconsult8-Jan-13 13:40
mvePIEBALDconsult8-Jan-13 13:40 
GeneralRe: Calling Console project Pin
BobJanova10-Jan-13 1:29
BobJanova10-Jan-13 1:29 
QuestionC# Reading Excel resource file Pin
Member 97041538-Jan-13 5:48
Member 97041538-Jan-13 5:48 
AnswerRe: C# Reading Excel resource file Pin
Richard MacCutchan8-Jan-13 6:18
mveRichard MacCutchan8-Jan-13 6:18 
GeneralRe: C# Reading Excel resource file Pin
eferreyra8-Jan-13 6:43
eferreyra8-Jan-13 6:43 
GeneralRe: C# Reading Excel resource file Pin
Richard MacCutchan8-Jan-13 6:46
mveRichard MacCutchan8-Jan-13 6:46 
GeneralRe: C# Reading Excel resource file Pin
Member 97041538-Jan-13 7:52
Member 97041538-Jan-13 7:52 

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.