2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System.DirectoryServices / System.DirectoryServices / SortOption.cs
1 //
2 // System.DirectoryServices.SortOption.cs
3 //
4 // Author:
5 //   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
6 //
7 // (C) 2004 Andreas Nahr
8 //
9 //
10
11 using System.ComponentModel;
12
13 namespace System.DirectoryServices {
14
15         [TypeConverter (typeof (ExpandableObjectConverter))]
16         public class SortOption
17         {
18                 private String propertyName;
19                 private SortDirection direction;
20
21                 public SortOption ()
22                 {
23                 }
24
25                 public SortOption (String propertyName, SortDirection direction)
26                 {
27                         this.propertyName = propertyName;
28                         this.direction = direction;
29                 }
30
31                 [DSDescription ("Name of propertion to be sorted on"),
32                  DefaultValue (null)]
33                 public String PropertyName {
34                         get { return propertyName; }
35                         set {
36                                 if (value == null)
37                                         throw new ArgumentNullException ("value");
38                                 propertyName = value;
39                         }
40                 }
41
42                 [DSDescription ("Whether the sort is ascending or descending"),
43                  DefaultValue (SortDirection.Ascending)]
44                 public SortDirection Direction {
45                         get { return direction; }
46                         set { direction = value; }
47                 }
48         }
49 }
50