I sometimes get very positively surprised by Microsoft. In the work of cleaning and structuring an Active Directory environment we wanted to produce a graphical overview of our current forest. It did not take long before I found Active Directory Topology Diagrammer, which is an absolute perfect tool for this purpose. And it is free!
Active Directory Topology Diagrammer gets the entire AD structure according to the parameters you supply and draws the structure in a Visio document. It does however require Visio 2003 or later installed to be able to do this export.
Binding an enumeration to a ComboBox can be done in several ways. In most cases you don't want to display the value itself, but a more user friendly description. One common approach is to use the DescriptionAttribute on the Enum values to supply a description for each value. This is all possible in a very MVVM friendly way. First step is to add the DescriptionAttribute to the values of the enumeration. public enum MyValues { [Description("First value")] First, [Description("Second value")] Second } To retrieve the description from the enum we use a simple extension method. This method returns the value of the DescriptionAttribute if it exists, otherwise the string representation of the enum value is returned. public static string GetDescription(this Enum value) { var fieldInfo = value.GetType().GetField(value.ToString()); var attribute = fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault() as ...
Comments
Post a Comment