示例#1
0
        //When tree-view item selected, fills the content list view with item properties
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (e.Action == TreeViewAction.ByMouse)
            {
                DirectoryEntity entity = ((DirectoryEntity)e.Node.Tag);

                this.listView1.Clear();
                this.listView1.Columns.Add("Property", 100);
                this.listView1.Columns.Add("Value", 300);

                foreach (string property in entity.Properties.PropertyNames)
                {
                    object value = entity.Properties[property].Value;
                    if (value.GetType().IsArray)
                    {
                        Array array = (Array)value;
                        for (int i = 0; i < array.Length; i++)
                        {
                            AddText(property, array.GetValue(i).ToString());
                        }
                    }
                    else
                    {
                        AddText(property, "" + value);
                    }
                }
            }
        }
示例#2
0
 public User(DirectoryEntity parent, PropertyCollection properties) : base(parent, properties)
 {
 }
示例#3
0
 public OrganizationalUnit(DirectoryEntity parent, PropertyCollection properties) : base(parent, properties)
 {
     this.entries = new List <DirectoryEntity>();
 }