title: Winforms: access class properties throughout application
body: <p>I know this must be an age-old, tired question, but I cant seem to find anything thru my trusty friend (aka Google).</p>
  
  <p>I have a .net 3.5 c# winforms app, that presents a user with a login form on application startup.  After a successful login, I want to run off to the DB, pull in some user-specific data and hold them (in properties) in a class called <em>AppCurrentUser.cs</em>, that can thereafer be accessed across all classes in the assembly - the purpose here being that I can fill some properties with a once-off data read, instead of making a call to the DB everytime I need to. In a web app, I would usually use Session variables, and I know that the concept of that does not exist in WinForms.</p>
  
  <p>The class structure resembles the following:</p>
  
  <pre><code>public class AppCurrentUser {
  
      public AppCurrentUser() { }
  
      public Guid UserName { get; set; }
      public List&lt;string&gt; Roles { get; set; }
      public string Firstname { get; set; }
      public string Lastname { get; set; }
  } 
  </code></pre>
  
  <p>Now, I have some options that I need some expert advice on:</p>
  
  <p>Being a "dumb" class, I should make the properties non-static, instantiate the class and then set the properties...but then I will only be able to access that instance from within the class that it was created in, right?</p>
  
  <p>Logically, I believe that these properties should be static as I will only be using the class <strong>once</strong> throughout the application (and <strong>not</strong> creating new instances of it), and it's property values will be "reset" on application close.  (If I create an instance of it, I can dispose of it on application close)</p>
  
  <p>How should I structure my class and how do I access its properties across all classes in my assembly? I really would appreciate your honest and valued advice on this!!</p>
  
  <p>Thanks!</p>