I'm making a program that has three classes:
- Output class receives data from other two classes, writes to two new strings, combines with special formatting to another string and outputs it
- AidaF class has a method that returns a value(a string) every second
- GmailF class has a method that returns a value(a string) every minute or so
so i tired using return string; to return the data from classes 2 and 3 to the first class but that just returns the value to the current class, not to the first class.
Here is this code I'm working on, slimmed down a lot though. but basics are there.
namespace Final { public class Output { public static void Main() { Console.WriteLine(gml + aida); } } public class AidaF { private static System.Timers.Timer aTimer; public static void AMain() { aTimer = new System.Timers.Timer(1000); aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); aTimer.Interval = 1000; aTimer.Enabled = true; } private static void OnTimedEvent(object source, ElapsedEventArgs e) { ... reader.ReadToFollowing("value"); aida.Append(reader.ReadElementContentAsString()).Append(","); return aida; ... } } public class GmaillF { private static System.Timers.Timer gTimer; public static void GMain() { gTimer = new System.Timers.Timer(200000); gTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent1); gTimer.Interval = 200000; gTimer.Enabled = true; } private static void OnTimedEvent1(object source, ElapsedEventArgs e) { CheckMail(); } public static string CheckMail() { ... gml.Append(reader.ReadElementContentAsString()).Append(","); return gml; ... } } }