I am looking at registry keys for a specific services. So I created a class so i could create my objects for the regKeys for the specific service.
There are multiple services that all have multiple reg keys for that specific service.
My class
class Component
{
private String regkey;
private String regpath;
//regkey
private String getRegkey(String name)
{ return name; }
public string regkeyProp
{
get { return (regkey); }
set { regkey = getRegkey(value); }
}
//regpath
private String getRegPath(String name)
{ return name; }
public string regPathProp
{
get { return (regpath); }
set { regpath = getRegPath(value); }
}
}
So now i have my class defined so I can create my objects. So one of my services is the
sync service. So i created my new object called sync.
Component SYNC= new Component();
My other function scans thought he array and grabs every single regkey & path for the sync service.
When I am building my Sync object, I am assigning my regkeyProperty.
Sync.regkeyProps = regkeyValue;
So the issue here is that there is many regkeys for one sync service and when it goes though the for loop though the array it only stores the last reg key each time.
I am just stumped how i can accomplish this. I would assume some sort of array?
I am guessing a bit of what it exactly is you are asking but i assume you want to keep a list of more than 1
Componentobjects. You could achieve this by doing something like this:Also as a side note i would suggest choosing a different name from
Componentas aComponentis already the name of some concept that is being used a lot in .NET