Question

I am trying to make an Active Directory Class that makes everything easier for me when I am using the same methods over and over again.

I know how to create the class and the methods but I don't quite understand how to do the subgroup kind of thing.

For example the DropDownList control. The only time I have seen the wrench in my class is when I am using the variable get/set method. Sorry if this does not make much sense, I dont know quite how to describe it.

See image for example:

Visual Studio Screenshot of DDLControl.Items.

How can I do this in such as a way that I can create something like....

ActiveDirectoryClass ADC = new ActiveDirectoryClass();
ADC.distinguishedName.GetUserName();

OR

ActiveDirectoryClass ADC = new ActiveDirectoryClass();
ADC.memberOf.Add(String groupname);
Was it helpful?

Solution

Those are "properties" in the class. Effectively, they're like variables that are attached to the instance of the class as a whole, rather than being in a specific function. They can themselves be simple things like bool or int, or classes like List<string> or MyOtherClass.

Check out the official tutorial.

OTHER TIPS

Simple. distinguishedName, membersOf are PROPERTIES. Which them contain another object.

when you call Add on memberOf, you do not call it on AcitiveDirectoryClass, but on the class that is in the memberOf property.

Read the documentation for both examples, it will make clear what classes you talk about here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top