Function from .cs file calling function from a different .cs file
What I am trying to do (in brief terms):
I have a function in a .cs file (A) that needs to access a function in a different .cs file (B). Based on certain calculations, (B) will alter (A) variables.
I keep getting the following WARNINGs:
warning CS0649: Field 'programX.MainWindow.tCodes' is never assigned to, and will always have its default value null
warning CS0649: Field 'programX.TriggerCodes.function_MainWindow' is never assigned to, and will always have its default value null
Possibly needed details:
OS: Windows 7 64-bit
Compiler: MS Visual Studio 2010 Ultimate
Language: C# (WPF)
And finally, a sample piece of code:
public partial class MainWindow : Window
public TriggerCodes tCodes;
protected internal void doSomething()
if (tCodes.triggerCodeFound("Hello World"))
Console.WriteLine("Didn't find it");
public void sayHello(string message)
StringBuilder msg = new StringBuilder();
// *should* write "Hello Silly Person!"
public partial class TriggerCodes
public MainWindow function_MainWindow;
public bool triggerCodeFound(String theData)
if ((theData.IndexOf("World") > (-1)))
I am a C/C++ coder by trade, and just learning C#. In C/C++, this is a rather simple concept for me to grasp, however, C# is kicking my arse and laughing all the way.
Any help to avenge this temporary nemesis would be awesome.