Also rename the constructor
[mono.git] / mcs / class / System.Drawing / System.Drawing.Printing / Margins.cs
1 //\r
2 // System.Drawing.Margins.cs\r
3 //\r
4 // Author:\r
5 //   Dennis Hayes (dennish@Raytek.com)\r
6 //\r
7 // (C) 2002 Ximian, Inc\r
8 //\r
9 using System;\r
10 \r
11 namespace System.Drawing.Printing {\r
12         /// <summary>\r
13         /// Summary description for Margins.\r
14         /// </summary>\r
15 \r
16         public class Margins {// : IClonable {\r
17                 /// <summary>\r
18                 /// left margin in hundredths of an inch\r
19                 /// </summary>\r
20                 int left;\r
21                 /// <summary>\r
22                 /// right margin in hundredths of an inch\r
23                 /// </summary>\r
24                 int right;\r
25                 /// <summary>\r
26                 /// top margin in hundredths of an inch\r
27                 /// </summary>\r
28                 int top;\r
29                 /// <summary>\r
30                 /// bottom margin in hundredths of an inch\r
31                 /// </summary>\r
32                 int bottom;\r
33 \r
34                 public Margins() {\r
35                         left = 100;\r
36                         right = 100;\r
37                         top = 100;\r
38                         bottom = 100;\r
39                 }\r
40                 public Margins(int left, int right, int top, int bottom) {\r
41                         //Verify parameters\r
42                         if(left < 0)\r
43                                 throw new System.ArgumentException("All Margins must be greater than 0", "left");\r
44                         if(right < 0)\r
45                                 throw new System.ArgumentException("All Margins must be greater than 0", "right");\r
46                         if(top < 0)\r
47                                 throw new System.ArgumentException("All Margins must be greater than 0", "top");\r
48                         if(bottom < 0)\r
49                                 throw new System.ArgumentException("All Margins must be greater than 0", "bottom");\r
50                         //Set proprities\r
51                         this.left = left;\r
52                         this.right = right;\r
53                         this.top = top;\r
54                         this.bottom = bottom;\r
55                 }\r
56 \r
57                 public int Left{\r
58                         get{\r
59                                 return left;\r
60                         }\r
61                         set{\r
62                                 left = value;\r
63                         }\r
64                 }\r
65 \r
66                 public int Right{\r
67                         get{\r
68                                 return right;\r
69                         }\r
70                         set{\r
71                                 right = value;\r
72                         }\r
73                 }\r
74 \r
75                 public int Top{\r
76                         get{\r
77                                 return top;\r
78                         }\r
79                         set{\r
80                                 top = value;\r
81                         }\r
82                 }\r
83 \r
84                 public int Bottom{\r
85                         get{\r
86                                 return bottom;\r
87                         }\r
88                         set{\r
89                                 bottom = value;\r
90                         }\r
91                 }\r
92         }\r
93 }\r