I just picked up learning C# less than a week ago. It's all I've been doing in my spare time, so I've made some nice progress on my own. But there's one question I can't seem to find an answer to through Google or any other site.
What I have written is something like the following:
vname = class1.itemName;
vval = class1.Value;
vamt = class1.Amount;
vbool = class1.isThisActive;
This repeats a great many times, but if I wanted to change the name of class1, I have to go in and change all of the lines (there are a lot more than four in my actual code, and this takes some time)
Would it at all be possible to do the following without running into errors?
vclass = class1;
vname = vclass.itemName; //returns the same as class1.itemName, ditto for all examples below
vval = vclass.Value;
vamt = vclass.Amount;
vbool = vclass.isThisActive;
This way I only need to have the actual cs document referenced once instead of a bunch of times. Keep in mind that all of the attributes of class1 (itemName, Value, Amount) need to be static, so I can't reference them through a public class variable
at the top of the document.
Any help is greatly appreciated.