solomon mwika

solomon mwika

  • 1.5k
  • 210
  • 7.9k

timer and passing values to methods from timer event

Jan 28 2014 8:09 AM
need some help trying to pass a value from a timer event
 
this is my timer event and method being called  Mywords ()
 _ourwordLength; is an instance variable that is returned by a method
 am calling getlength  ie  int getlength(int _ourwordLength ){ return _ourwordLength; }
 private static int _ourwordLength;
 
public void Timer_tick(object sender, EventArgs e)
{
Mywords(_ourwordLength);
}
  The method am passing value to is below
 
 
public void Mywords( int length)
{

var ResourceStream = Application.GetResourceStream(new Uri("TextFile1.txt", UriKind.Relative));
using (Stream Myfilestream = ResourceStream.Stream)
{
string s = "";
StreamReader myStreamReader = new StreamReader(Myfilestream);
s = myStreamReader.ReadToEnd();
// string regExp;
if (length == 5)
{
MywordsLength();
 The problem i have is once the value _ourwordLength is passed to the Timer event  where am calling the mywords method its is not being passed to the
mywords method help on this plis
 
 

Answers (3)