title: Elegant way to save/load values into an array
body: <p>I'm basically saving and loading values into an array to feed into a JSON library, and I'm just looking for a more elegant way to do this:</p>
  
  <p><strong>class properties to array</strong></p>
  
  <pre><code> return new object[] { path, pathDir, name };
  </code></pre>
  
  <p><strong>array to class properties</strong></p>
  
  <pre><code>c.path = values[0];
  c.pathDir = values[1];
  c.name = values[2];
  </code></pre>
  
  <p>Simple solutions that ideally do not require additional run time overheads such as Reflection are appreciated.</p>
  
  <p>Can I do something like this?</p>
  
  <pre><code>  c.{path, pathDir, name} = values[0...2]
  </code></pre>
  
  <p><strong>Edit:</strong> I'm specifically asking for arrays. I know about serialization and JSON and Protobuf and everything else everyone is suggesting.</p>