Last active
November 8, 2016 22:04
-
-
Save ChrisMoney/6d32c18aed89e65efb799a31d2e723e8 to your computer and use it in GitHub Desktop.
Referenced project gets and sets data from parent project - C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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