New test.
[mono.git] / mcs / class / System.DirectoryServices / System.DirectoryServices / SearchResult.cs
index 35624c80a6a761a876979c5ab0c390d591c0044b..c9abd5b08ad19e4448c5175dfdd0cb5d10f292a5 100644 (file)
@@ -102,21 +102,18 @@ namespace System.DirectoryServices
                                        while(id.MoveNext())
                                        {
                                                string attribute=(string)id.Key;
-                                               LdapAttribute attr=null;
                                                        ResultPropertyValueCollection rpVal=
                                                                new ResultPropertyValueCollection();
                                                        if(Rproperties[attribute].Count==1)
                                                        {
                                                                String val = (String)Rproperties[attribute].Value;
-//                                                         Console.WriteLine("attribute:" + attribute + "value:" + val);
                                                                rpVal.Add(val);
                                                        }
-                                                       else
+                                                       else if (Rproperties[attribute].Count > 1)
                                                        {
                                                                Object[] vals=(Object [])Rproperties[attribute].Value;
 //                                                             String[] aStrVals= new String[_Entry.Properties[attribute].Count];
                                                                rpVal.AddRange(vals);
-//                                                         Console.WriteLine("attribute1:" + attribute + "value:" +vals[0]);
                                                        }
                                                        _Properties.Add(attribute,rpVal);
                                        }
@@ -130,12 +127,14 @@ namespace System.DirectoryServices
                {
                        InitBlock();
                        _Entry = entry;
+                       _Path = entry.Path;
                }
 
                internal SearchResult(DirectoryEntry entry, PropertyCollection props)
                {
                        InitBlock();
                        _Entry = entry;
+                       _Path = entry.Path;
                        _Rproperties = props;
                }
                /// <summary>