PrinterPage.deserialize constructor

PrinterPage.deserialize(
  1. XmlElement node
)

Implementation

PrinterPage.deserialize(XmlElement node)
    : super.deserialize(node, ['eval-property', 'printer-config', 'font-type']) {
  assert(this.children.isNotEmpty, 'Page必须要有下级');
  assert(this.children.length == 1, 'Page的下级只能有一个');
  for (var child in node.children) {
    if (child is XmlElement) {
      if (child.name.local == 'eval-property') {
        evalPropertys.add(EvalProperty.deserialize(child));
      } else if (child.name.local == 'printer-config') {
        printerConfig = PrinterConfig.deserialize(child);
      } else if (child.name.local == 'font-type') {
        fontTypes.add(PrinterFontType.deserialize(child));
      }
    }
  }
}