Click here to Skip to main content
16,005,169 members
Home / Discussions / C#
   

C#

 
Questionwhy file created event in Windows Servcice fires only once? Pin
Bharat Gadhia15-Aug-06 9:46
Bharat Gadhia15-Aug-06 9:46 
AnswerRe: why file created event in Windows Servcice fires only once? Pin
Ennis Ray Lynch, Jr.15-Aug-06 12:44
Ennis Ray Lynch, Jr.15-Aug-06 12:44 
Questionglobal variable .... Pin
mostafa_h15-Aug-06 9:25
mostafa_h15-Aug-06 9:25 
AnswerRe: global variable .... Pin
Judah Gabriel Himango15-Aug-06 9:54
sponsorJudah Gabriel Himango15-Aug-06 9:54 
GeneralRe: global variable .... Pin
mostafa_h15-Aug-06 10:59
mostafa_h15-Aug-06 10:59 
GeneralRe: global variable .... Pin
Judah Gabriel Himango15-Aug-06 11:50
sponsorJudah Gabriel Himango15-Aug-06 11:50 
GeneralRe: global variable .... Pin
User 665815-Aug-06 12:15
User 665815-Aug-06 12:15 
AnswerRe: global variable .... Pin
beatles169215-Aug-06 13:17
beatles169215-Aug-06 13:17 
Using a global variable is not a good idea.
I think that it's better to use parameter objects rather than global variables.
For example if you have to pass x,y and z to a formula calculator you can have a object that gets x,y and z as parameters and then you can pass this object to a suitable metohd of your calculator.
In form1
<br />
public FormulaParams GetFormulaParameters()<br />
{<br />
FormulaParams params=new FormulaParams();<br />
params.x=int.Parse(this.txtX.Text);<br />
params.y=int.Parse(this.txtY.Text);<br />
params.z=int.Parse(this.txtZ.Text);<br />
return params;<br />
}<br />

In form2
<br />
public void Calculate()<br />
{<br />
Form1 form1=new Form1();<br />
form1.ShowDialog();<br />
int result=new Formula().Calculate(form1.GetFormulaParameters());<br />
}<br />

GeneralRe: global variable .... [modified] Pin
mostafa_h15-Aug-06 20:50
mostafa_h15-Aug-06 20:50 
GeneralRe: global variable .... Pin
beatles169215-Aug-06 22:24
beatles169215-Aug-06 22:24 
GeneralRe: global variable .... [modified] Pin
mostafa_h15-Aug-06 23:26
mostafa_h15-Aug-06 23:26 
GeneralRe: global variable .... Pin
mostafa_h16-Aug-06 19:54
mostafa_h16-Aug-06 19:54 
QuestionTabPage out of order Pin
Kenny O'Dell15-Aug-06 9:14
Kenny O'Dell15-Aug-06 9:14 
AnswerRe: TabPage out of order Pin
Nader Elshehabi15-Aug-06 11:49
Nader Elshehabi15-Aug-06 11:49 
AnswerRe: TabPage out of order Pin
Judah Gabriel Himango15-Aug-06 11:50
sponsorJudah Gabriel Himango15-Aug-06 11:50 
QuestionVisual Studio 2005 Deployment Pin
Marco225015-Aug-06 8:47
Marco225015-Aug-06 8:47 
AnswerRe: Visual Studio 2005 Deployment Pin
Judah Gabriel Himango15-Aug-06 9:13
sponsorJudah Gabriel Himango15-Aug-06 9:13 
GeneralRe: Visual Studio 2005 Deployment [modified] Pin
Marco225015-Aug-06 9:58
Marco225015-Aug-06 9:58 
GeneralRe: Visual Studio 2005 Deployment Pin
Judah Gabriel Himango15-Aug-06 12:00
sponsorJudah Gabriel Himango15-Aug-06 12:00 
QuestionRe: Visual Studio 2005 Deployment Pin
Nader Elshehabi15-Aug-06 11:40
Nader Elshehabi15-Aug-06 11:40 
AnswerRe: Visual Studio 2005 Deployment Pin
Judah Gabriel Himango15-Aug-06 11:59
sponsorJudah Gabriel Himango15-Aug-06 11:59 
QuestionDouble value from negative to positive Pin
Saamir15-Aug-06 8:05
Saamir15-Aug-06 8:05 
AnswerRe: Double value from negative to positive Pin
leppie15-Aug-06 8:21
leppie15-Aug-06 8:21 
AnswerRe: Double value from negative to positive Pin
Dan Neely15-Aug-06 8:38
Dan Neely15-Aug-06 8:38 
AnswerRe: Double value from negative to positive Pin
Josh Smith15-Aug-06 8:42
Josh Smith15-Aug-06 8:42 

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.