Пример #1
0
        public Dictionary <string, VMDirAttributeDTO> GetEntryProperties(ILdapEntry entry)
        {
            Dictionary <string, VMDirAttributeDTO> properties = new Dictionary <string, VMDirAttributeDTO>();

            string[] attNamerArr = entry.getAttributeNames().ToArray();
            foreach (string attrName in attNamerArr)
            {
                LdapValue[]       attrValArr = entry.getAttributeValues(attrName).ToArray();
                var               typeDTO    = _schemaManager.GetAttributeType(attrName);
                VMDirAttributeDTO dto        = new VMDirAttributeDTO(attrName, new List <LdapValue>(attrValArr), typeDTO);
                properties[attrName] = dto;
            }
            return(properties);
        }
Пример #2
0
        private void Bind()
        {
            var requiredProps = _serverDTO.Connection.SchemaManager.GetRequiredAttributes(_objectClass);

            _properties = new Dictionary <string, VMDirAttributeDTO>();
            foreach (var prop in requiredProps)
            {
                VMDirAttributeDTO dto = new VMDirAttributeDTO(prop.Name, new List <VMDirInterop.LDAP.LdapValue>(), prop);
                _properties.Add(prop.Name, dto);
            }
            var       oc  = _properties[VMDirConstants.ATTR_OBJECT_CLASS];
            LdapValue val = new LdapValue(_objectClass);

            oc.Values = new List <LdapValue>()
            {
                val
            };
            Utilities.RemoveDontShowAttributes(_properties);
        }
Пример #3
0
        void Bind()
        {
            this.Text            = "New " + _objectClass;
            textBoxParentDn.Text = _parentDn;
            MiscUtilsService.CheckedExec(delegate
            {
                var requiredProps = _serverDTO.Connection.SchemaManager.GetRequiredAttributes(_objectClass);
                _properties       = new Dictionary <string, VMDirAttributeDTO>();
                foreach (var prop in requiredProps)
                {
                    VMDirAttributeDTO dto = new VMDirAttributeDTO(prop.Name, new List <LdapValue>(), prop);
                    _properties.Add(prop.Name, dto);
                }
                var oc        = _properties[VMDirConstants.ATTR_OBJECT_CLASS];
                LdapValue val = new LdapValue(_objectClass);
                oc.Values     = new List <LdapValue>()
                {
                    val
                };
                VMDir.Common.VMDirUtilities.Utilities.RemoveDontShowAttributes(_properties);

                foreach (var item in _properties)
                {
                    foreach (var values in item.Value.Values)
                    {
                        ListViewItem lvi = new ListViewItem(new string[] { item.Key, values.StringValue });
                        this.listViewProp.Items.Add(lvi);
                    }
                    if (item.Value.Values.Count == 0)
                    {
                        ListViewItem lvi = new ListViewItem(new string[] { item.Key, string.Empty });
                        this.listViewProp.Items.Add(lvi);
                    }
                }
            });
        }