PrinterSettings.cs 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. //
  2. // System.Drawing.PrinterSettings.cs
  3. //
  4. // Author:
  5. // Dennis Hayes ([email protected])
  6. // Herve Poussineau ([email protected])
  7. //
  8. // (C) 2002 Ximian, Inc
  9. //
  10. using System;
  11. using System.Collections;
  12. using System.Drawing.Printing;
  13. namespace System.Drawing.Printing
  14. {
  15. /// <summary>
  16. /// Summary description for PrinterSettings.
  17. /// </summary>
  18. ///
  19. [Serializable]
  20. //[ComVisible(false)]
  21. public class PrinterSettings : ICloneable{
  22. public PrinterSettings()
  23. {
  24. }
  25. // SUBCLASS
  26. /// <summary>
  27. /// Summary description for PaperSourceCollection.
  28. /// </summary>
  29. public class PaperSourceCollection : ICollection, IEnumerable {
  30. ArrayList _PaperSources = new ArrayList();
  31. public PaperSourceCollection(PaperSource[] array) {
  32. foreach (PaperSource ps in array)
  33. _PaperSources.Add(ps);
  34. }
  35. public int Count { get { return _PaperSources.Count; } }
  36. bool ICollection.IsSynchronized { get { return false; } }
  37. object ICollection.SyncRoot { get { return this; } }
  38. public virtual PaperSource this[int index] {
  39. get { return _PaperSources[index] as PaperSource; }
  40. }
  41. IEnumerator IEnumerable.GetEnumerator()
  42. {
  43. return _PaperSources.GetEnumerator();
  44. }
  45. void ICollection.CopyTo(Array array, int index)
  46. {
  47. _PaperSources.CopyTo(array, index);
  48. }
  49. }
  50. /// <summary>
  51. /// Summary description for PaperSizeCollection.
  52. /// </summary>
  53. public class PaperSizeCollection : ICollection, IEnumerable {
  54. ArrayList _PaperSizes = new ArrayList();
  55. public PaperSizeCollection(PaperSize[] array) {
  56. foreach (PaperSize ps in array)
  57. _PaperSizes.Add(ps);
  58. }
  59. public int Count { get { return _PaperSizes.Count; } }
  60. bool ICollection.IsSynchronized { get { return false; } }
  61. object ICollection.SyncRoot { get { return this; } }
  62. public virtual PaperSize this[int index] {
  63. get { return _PaperSizes[index] as PaperSize; }
  64. }
  65. IEnumerator IEnumerable.GetEnumerator()
  66. {
  67. return _PaperSizes.GetEnumerator();
  68. }
  69. void ICollection.CopyTo(Array array, int index)
  70. {
  71. _PaperSizes.CopyTo(array, index);
  72. }
  73. }
  74. /// <summary>
  75. /// Summary description for PrinterResolutionCollection.
  76. /// </summary>
  77. public class PrinterResolutionCollection : ICollection, IEnumerable {
  78. ArrayList _PrinterResolutions = new ArrayList();
  79. public PrinterResolutionCollection(PrinterResolution[] array) {
  80. foreach (PrinterResolution pr in array)
  81. _PrinterResolutions.Add(pr);
  82. }
  83. public int Count { get { return _PrinterResolutions.Count; } }
  84. bool ICollection.IsSynchronized { get { return false; } }
  85. object ICollection.SyncRoot { get { return this; } }
  86. public virtual PrinterResolution this[int index] {
  87. get { return _PrinterResolutions[index] as PrinterResolution; }
  88. }
  89. IEnumerator IEnumerable.GetEnumerator()
  90. {
  91. return _PrinterResolutions.GetEnumerator();
  92. }
  93. void ICollection.CopyTo(Array array, int index)
  94. {
  95. _PrinterResolutions.CopyTo(array, index);
  96. }
  97. }
  98. /// <summary>
  99. /// Summary description for PrinterResolutionCollection.
  100. /// </summary>
  101. public class StringCollection : ICollection, IEnumerable {
  102. ArrayList _Strings = new ArrayList();
  103. public StringCollection(string[] array) {
  104. foreach (string s in array)
  105. _Strings.Add(s);
  106. }
  107. int ICollection.Count { get { return _Strings.Count; } }
  108. bool ICollection.IsSynchronized { get { return false; } }
  109. object ICollection.SyncRoot { get { return this; } }
  110. IEnumerator IEnumerable.GetEnumerator()
  111. {
  112. return _Strings.GetEnumerator();
  113. }
  114. void ICollection.CopyTo(Array array, int index)
  115. {
  116. _Strings.CopyTo(array, index);
  117. }
  118. }
  119. //props
  120. //[MonoTODO("PrinterSettings.CanDuplex")]
  121. //public bool CanDuplex
  122. //{
  123. // get { throw new NotImplementedException(); }
  124. //}
  125. //[MonoTODO("PrinterSettings.Collate")]
  126. //public bool Collate
  127. //{
  128. // get { throw new NotImplementedException(); }
  129. // set { throw new NotImplementedException(); }
  130. //}
  131. //[MonoTODO("PrinterSettings.Copies")]
  132. //public short Copies
  133. //{
  134. // get { throw new NotImplementedException(); }
  135. // set { throw new NotImplementedException(); }
  136. //}
  137. [MonoTODO("PrinterSettings.DefaultPageSettings")]
  138. public PageSettings DefaultPageSettings
  139. {
  140. get
  141. {
  142. return new PageSettings(
  143. this,
  144. // TODO: get default color mode for this printer
  145. false,
  146. // TODO: get default orientation for this printer
  147. false,
  148. // TODO: get default paper size for this printer
  149. new PaperSize("A4", 827, 1169),
  150. // TODO: get default paper source for this printer
  151. new PaperSource("default", PaperSourceKind.FormSource),
  152. // TODO: get default resolution for this printer
  153. new PrinterResolution(300, 300, PrinterResolutionKind.Medium)
  154. );
  155. }
  156. }
  157. //[MonoTODO("PrinterSettings.Duplex")]
  158. //public Duplex Duplex
  159. //{
  160. // get { throw new NotImplementedException(); }
  161. // set { throw new NotImplementedException(); }
  162. //}
  163. //[MonoTODO("PrinterSettings.FromPage)]
  164. //public int FromPage
  165. //{
  166. // get { throw new NotImplementedException(); }
  167. // set { throw new NotImplementedException(); }
  168. //}
  169. //[MonoTODO("PrinterSettings.InstalledPrinters")]
  170. //public static PrinterSettings.StringCollection InstalledPrinters
  171. //{
  172. // get { throw new NotImplementedException(); }
  173. //}
  174. //[MonoTODO("PrinterSettings.IsDefaultPrinter")]
  175. //public bool IsDefaultPrinter
  176. //{
  177. // get { throw new NotImplementedException(); }
  178. //}
  179. //[MonoTODO("PrinterSettings.IsPlotter")]
  180. //public bool IsPlotter
  181. //{
  182. // get { throw new NotImplementedException(); }
  183. //}
  184. //[MonoTODO("PrinterSettings.IsValid")]
  185. //public bool IsValid
  186. //{
  187. // get { throw new NotImplementedException(); }
  188. //}
  189. //[MonoTODO("PrinterSettings.LandscapeAngle")]
  190. //public int LandscapeAngle
  191. //{
  192. // get { throw new NotImplementedException(); }
  193. //}
  194. //[MonoTODO("PrinterSettings.MaximumCopies")]
  195. //public int MaximumCopies
  196. //{
  197. // get { throw new NotImplementedException(); }
  198. //}
  199. //[MonoTODO("PrinterSettings.MaximumPage")]
  200. //public int MaximumPage
  201. //{
  202. // get { throw new NotImplementedException(); }
  203. // set { throw new NotImplementedException(); }
  204. //}
  205. //[MonoTODO("PrinterSettings.MinimumPage")]
  206. //public int MinimumPage
  207. //{
  208. // get { throw new NotImplementedException(); }
  209. // set { throw new NotImplementedException(); }
  210. //}
  211. //[MonoTODO("PrinterSettings.PaperSizes")]
  212. //public PrinterSettings.PaperSizeCollection PaperSizes
  213. //{
  214. // get { throw new NotImplementedException(); }
  215. //}
  216. //[MonoTODO("PrinterSettings.PaperSources")]
  217. //public PrinterSettings.PaperSourceCollection PaperSources
  218. //{
  219. // get { throw new NotImplementedException(); }
  220. //}
  221. //[MonoTODO("PrinterSettings.PrinterName")]
  222. //public string PrinterName
  223. //{
  224. // get { throw new NotImplementedException(); }
  225. // set { throw new NotImplementedException(); }
  226. //}
  227. //[MonoTODO("PrinterSettings.PrinterResolutions")]
  228. //public PrinterSettings.PrinterResolutionCollection PrinterResolutions
  229. //{
  230. // get { throw new NotImplementedException(); }
  231. //}
  232. //[MonoTODO("PrinterSettings.PrintRange")]
  233. //public PrintRange PrintRange
  234. //{
  235. // get { throw new NotImplementedException(); }
  236. // set { throw new NotImplementedException(); }
  237. //}
  238. //[MonoTODO("PrinterSettings.PrintToFile")]
  239. //public bool PrintToFile
  240. //{
  241. // get { throw new NotImplementedException(); }
  242. // set { throw new NotImplementedException(); }
  243. //}
  244. //[MonoTODO("PrinterSettings.SupportsColor")]
  245. //public bool SupportsColor
  246. //{
  247. // get { throw new NotImplementedException(); }
  248. //}
  249. //[MonoTODO("PrinterSettings.ToPage")]
  250. //public int ToPage
  251. //{
  252. // get { throw new NotImplementedException(); }
  253. // set { throw new NotImplementedException(); }
  254. //}
  255. //methods
  256. [MonoTODO("PrinterSettings.Clone")]
  257. public virtual object Clone()
  258. {
  259. throw new NotImplementedException();
  260. }
  261. //[MonoTODO("PrinterSettings.CreateMeasurementGraphics")]
  262. //public Graphics CreateMeasurementGraphics()
  263. //{
  264. // throw new NotImplementedException();
  265. //}
  266. //[MonoTODO("PrinterSettings.GetHdevmode")]
  267. //public IntPtr GetHdevmode()
  268. //{
  269. // throw new NotImplementedException();
  270. //}
  271. //[MonoTODO("PrinterSettings.GetHdevmode")]
  272. //public IntPtr GetHdevmode(PageSettings pageSettings)
  273. //{
  274. // throw new NotImplementedException();
  275. //}
  276. //[MonoTODO("PrinterSettings.GetHdevname")]
  277. //public IntPtr GetHdevnames()
  278. //{
  279. // throw new NotImplementedException();
  280. //}
  281. //[MonoTODO("PrinterSettings.SetHdevmode")]
  282. //public void SetHdevmode(IntPtr hdevmode)
  283. //{
  284. // throw new NotImplementedException();
  285. //}
  286. //[MonoTODO("PrinterSettings.SetHdevnames")]
  287. //public void SetHdevnames(IntPtr hdevnames)
  288. //{
  289. // throw new NotImplementedException();
  290. //}
  291. //[MonoTODO("PrinterSettings.ToString"]
  292. //public override string ToString()
  293. //{
  294. // throw new NotImplementedException();
  295. //}
  296. }
  297. }