using System.DirectoryServices.Design;
using System.Collections.Specialized;
using System.Configuration;
+using System.Runtime.InteropServices;
namespace System.DirectoryServices
{
string defaultHost = (string) AppDomain.CurrentDomain.GetData (DEFAULT_LDAP_HOST);
if (defaultHost == null) {
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("System.DirectoryServices/Settings");
+ NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
if (config != null)
defaultHost = config ["servername"];
string defaultPortStr = (string) AppDomain.CurrentDomain.GetData (DEFAULT_LDAP_PORT);
if (defaultPortStr == null) {
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("System.DirectoryServices/Settings");
+ NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
if (config != null)
defaultPortStr = config ["port"];
throw new NotImplementedException();
}
+#if NET_2_0
+ /// <summary>
+ /// Gets a property value from the native Active Directory Entry.
+ /// </summary>
+ /// <param name="propertyName">The name of the property to get.
+ /// </param>
+ /// <returns>The value of the property</returns>
+ /// <remarks>
+ /// Not implemented yet.
+ [ComVisibleAttribute (false)]
+ [MonoNotSupported ("")]
+ public object InvokeGet (string propertyName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ /// <summary>
+ /// Sets a property value on the native Active Directory Entry.
+ /// </summary>
+ /// <param name="propertyName">The name of the property to get.
+ /// </param>
+ /// <param name="args">
+ /// An array of type Object that contains the arguments of the property
+ /// beeing set.
+ /// </param>
+ /// <remarks>
+ /// Not implemented yet.
+ [ComVisibleAttribute (false)]
+ [MonoNotSupported ("")]
+ public void InvokeSet (string propertyName, params object [] args)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
+
/// <summary>
/// Creates a copy of this entry, as a child of the specified parent, with
/// the specified new name.
LdapAttribute attr=null;
if (properties [attribute].Mbit)
{
- if (properties [attribute].Count == 1)
- {
- string val = (string) properties [attribute].Value;
- attr = new LdapAttribute( attribute , val);
- }
- else
- {
- object[] vals =(object []) properties [attribute].Value;
- string[] aStrVals = new string [properties [attribute].Count];
- Array.Copy (vals,0,aStrVals,0,properties [attribute].Count);
- attr = new LdapAttribute( attribute , aStrVals);
+ switch (properties [attribute].Count) {
+ case 0:
+ attr = new LdapAttribute (attribute, new string [0]);
+ modList.Add (new LdapModification (LdapModification.DELETE, attr));
+ break;
+ case 1:
+ string val = (string) properties [attribute].Value;
+ attr = new LdapAttribute (attribute, val);
+ modList.Add (new LdapModification (LdapModification.REPLACE, attr));
+ break;
+ default:
+ object [] vals = (object [])properties [attribute].Value;
+ string [] aStrVals = new string [properties [attribute].Count];
+ Array.Copy (vals, 0, aStrVals, 0, properties [attribute].Count);
+ attr = new LdapAttribute (attribute, aStrVals);
+ modList.Add (new LdapModification (LdapModification.REPLACE, attr));
+ break;
}
- modList.Add( new LdapModification(LdapModification.REPLACE, attr));
properties [attribute].Mbit=false;
}
}
if (modList.Count > 0) {
LdapModification[] mods = new LdapModification[modList.Count];
- Type mtype=Type.GetType("System.DirectoryServices.LdapModification");
- mods = (LdapModification[])modList.ToArray(typeof(LdapModification));
+ Type mtype = typeof (LdapModification);
+ mods = (LdapModification[])modList.ToArray(mtype);
ModEntry(mods);
}
}