Skip to content

Instantly share code, notes, and snippets.

@ChrisMoney
Last active November 8, 2016 22:04
Show Gist options
  • Save ChrisMoney/6d32c18aed89e65efb799a31d2e723e8 to your computer and use it in GitHub Desktop.
Save ChrisMoney/6d32c18aed89e65efb799a31d2e723e8 to your computer and use it in GitHub Desktop.
Referenced project gets and sets data from parent project - C#
namespace ReferencedProject
{
public class ReferencedClass
{
// use public static Properties in a non static class to pass and set in parent project
public static int LocId;
public static int DeviceTag;
}
}
namespace ParentProject {
// must set properties in non static class
public class ParentClass {
int locId = 4;
int deviceTag = 300;
// Pass to child project
ReferencedClass.LocId = locId;
ReferencedClass.DeviceTag = deviceTag;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment