示例#1
0
        public ServerEntry(ILdapEntry entry)
        {
            dn = entry.getDN();
            LdapValue val = entry.getAttributeValues(AttributeConstants.CN)[0];

            serverName = val.StringValue;
        }
示例#2
0
        public DseRootEntry(ILdapEntry entry)
        {
            LdapValue val = entry.getAttributeValues(AttributeConstants.NAMING_CONTEXT)[0];

            domain = val.StringValue;

            val      = entry.getAttributeValues(AttributeConstants.SERVER_NAME)[0];
            serverDn = val.StringValue;
        }
示例#3
0
        public SchemaEntry(ILdapEntry entry)
        {
            LdapValue val = entry.getAttributeValues(AttributeConstants.CN)[0];

            defName = val.StringValue;

            List <LdapValue> vals = entry.getAttributeValues(AttributeConstants.ATTRIBUTE_METADATA);

            metadataList = ConstructMetadataList(vals);
        }
示例#4
0
        private void exitEditing()
        {
            ListViewItem lvi = listViewProp.SelectedItems[0];

            System.Windows.Forms.ListViewItem.ListViewSubItem lvsi = lvi.SubItems[1];
            lvsi.Text           = textBoxEdit.Text;
            textBoxEdit.Visible = false;
            LdapValue val = new LdapValue(lvsi.Text);

            _properties[lvi.SubItems[0].Text].Values = new List <LdapValue>()
            {
                val
            };
        }
示例#5
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);
        }
 public override void SetObjectValue(NSTableView tableView, NSObject editedVal, NSTableColumn col, nint row)
 {
     try
     {
         if (Entries != null && !string.IsNullOrEmpty(editedVal.ToString()))
         {
             if (col.Identifier == "Value")
             {
                 string    currKey = this.Entries.Keys.ElementAt((int)row);
                 LdapValue val     = new LdapValue(editedVal.ToString());
                 this.Entries[currKey].Values = new List <VMDirInterop.LDAP.LdapValue>()
                 {
                     val
                 };
             }
         }
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine("Error in List Operation " + e.Message);
     }
 }
示例#7
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);
                    }
                }
            });
        }
示例#8
0
        //returns LDAPValue  from string
        public static LdapValue StringToLdapValue(string stringVal)
        {
            LdapValue val = new LdapValue(stringVal);

            return(val);
        }