public System.Object Clone()
{
LdapControl cont;
try
{
cont = (LdapControl) base.MemberwiseClone();
}
catch (System.Exception ce)
{
throw new System.SystemException("Internal error, cannot create clone");
}
sbyte[] vals = this.getValue();
sbyte[] twin = null;
if (vals != null)
{
//is this necessary?
// Yes even though the contructor above allocates a
// new Asn1OctetString, vals in that constuctor
// is only copied by reference
twin = new sbyte[vals.Length];
for (int i = 0; i < vals.Length; i++)
{
twin[i] = vals[i];
}
cont.control = new RfcControl(new RfcLdapOID(ID), new Asn1Boolean(Critical), new Asn1OctetString(twin));
}
return cont;
}