123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Runtime.Serialization;
- using System.Xml.Serialization;
- namespace fis.Win.Dev.Managers.Interfaces.Printer
- {
- [JsonObject(MemberSerialization.OptIn)]
- public class PrinterInfo : ISerializable
- {
- [JsonProperty(PropertyName = "Name")]
- public string Name { get; set; }
- [JsonProperty(PropertyName = "PageSize")]
- public string PageSize { get; set; }
- [JsonProperty(PropertyName = "PageOrientation")]
- public string PageOrientation { get; set; }
- [JsonProperty(PropertyName = "PageOrientationList")]
- public List<string> PageOrientationList { get; set; }
- [JsonProperty(PropertyName = "PageSizeList")]
- public List<string> PageSizeList { get; set; }
- [JsonProperty(PropertyName = "Manufacturer")]
- public string Manufacturer { get; set; }
- public PrinterInfo()
- {
- }
- protected PrinterInfo(SerializationInfo info, StreamingContext context)
- {
- Name = (string)info.GetValue("Name", typeof(string));
- PageSize = (string)info.GetValue("PageSize", typeof(string));
- PageOrientation = (string)info.GetValue("PageOrientation", typeof(string));
- PageOrientationList = (List<string>)info.GetValue("PageOrientationList", typeof(List<string>));
- PageSizeList = (List<string>)info.GetValue("PageSizeList", typeof(List<string>));
- Manufacturer = (string)info.GetValue("Manufacturer", typeof(string));
- }
- public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- info.AddValue("Name", Name);
- info.AddValue("PageSize", PageSize);
- info.AddValue("PageOrientation", PageOrientation);
- info.AddValue("PageOrientationList", PageOrientationList);
- info.AddValue("PageSizeList", PageSizeList);
- info.AddValue("Manufacturer", Manufacturer);
- }
- }
- /// <summary>
- /// The network printer info.
- /// </summary>
- [JsonObject(MemberSerialization.OptIn)]
- public class NetworkPrinterInfo : PrinterInfo
- {
- /// <summary>
- /// Gets or sets the IP address.
- /// </summary>
- [JsonProperty(PropertyName = "IPAddress")]
- public string IPAddress { get; set; }
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData(info, context);
- info.AddValue("IPAddress", IPAddress);
- }
- }
- /// <summary>
- /// The remote maintenance script execute result info.
- /// </summary>
- [Serializable]
- public class ExecuteResultInfo : ISerializable
- {
- /// <summary>
- /// Gets or sets the action type.
- /// </summary>
- public string ActionType { get; set; }
- /// <summary>
- /// Gets or sets the action result.
- /// </summary>
- public string Result { get; set; }
- public void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- info.AddValue("ActionType", ActionType);
- info.AddValue("Result", Result);
- }
- }
- /// <summary>
- /// The printer setting info or result from ultrasonic machine.
- /// </summary>
- [Serializable]
- public class PrinterSettingInfo : ISerializable
- {
- /// <summary>
- /// Gets or sets the printers.
- /// </summary>
- public List<PrinterInfo> Printers { get; set; }
- /// <summary>
- /// Gets or sets the execute result.
- /// </summary>
- public ExecuteResultInfo ExecuteResult { get; set; }
- public void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- info.AddValue("Printers", Printers);
- info.AddValue("ExecuteResult", ExecuteResult);
- }
- }
- }
|