PrinterSettings.cs 8.2 KB

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