public override bool from_byte(byte[] buffer, ref long pos) { if (!base.from_byte(buffer, ref pos)) { return(false); } if (!this.user.from_byte(buffer, ref pos)) { return(false); } this.report_files_ready = to_bool(buffer, ref pos); this.dcm_files_ready = to_bool(buffer, ref pos); this.report_files_number = Cmd.to_int(buffer, ref pos); this.dcm_files_number = Cmd.to_int(buffer, ref pos); this.transfer_report_files = to_bool(buffer, ref pos); this.transfer_dcm_files = to_bool(buffer, ref pos); this.report_file_contents = null; if (this.transfer_report_files) { this.report_file_contents = FileNameContentItem.to_contents(buffer, ref pos); } this.dcm_file_contents = null; if (this.transfer_dcm_files) { this.dcm_file_contents = FileNameContentItem.to_contents(buffer, ref pos); } this.printed_report_times = Cmd.to_int(buffer, ref pos); this.printed_dcm_times = Cmd.to_int(buffer, ref pos); return(true); }
public static List <FileNameContentItem> to_contents(byte[] buffer, ref long pos) { List <FileNameContentItem> items = new List <FileNameContentItem>(); int size = Cmd.to_int(buffer, ref pos); for (int i = 0; i < size; i++) { FileNameContentItem item = new FileNameContentItem(); if (!item.from_byte(buffer, ref pos)) { return(null); } items.Add(item); } return(items); }
public override List <byte> to_byte() { List <byte> buffer = base.to_byte(); buffer.AddRange(this.user.to_byte()); buffer.AddRange(get_bytes(this.report_files_ready)); buffer.AddRange(get_bytes(this.dcm_files_ready)); buffer.AddRange(Cmd.get_bytes(this.report_files_number)); buffer.AddRange(Cmd.get_bytes(this.dcm_files_number)); buffer.AddRange(get_bytes(this.transfer_report_files)); buffer.AddRange(get_bytes(this.transfer_dcm_files)); if (this.transfer_report_files) { buffer.AddRange(FileNameContentItem.get_bytes(this.report_file_contents)); } if (this.transfer_dcm_files) { buffer.AddRange(FileNameContentItem.get_bytes(this.dcm_file_contents)); } buffer.AddRange(Cmd.get_bytes(this.printed_report_times)); buffer.AddRange(Cmd.get_bytes(this.printed_dcm_times)); return(buffer); }
public static List<FileNameContentItem> to_contents(byte[] buffer, ref long pos) { List<FileNameContentItem> items = new List<FileNameContentItem>(); int size = Cmd.to_int(buffer, ref pos); for (int i = 0; i < size; i++) { FileNameContentItem item = new FileNameContentItem(); if (!item.from_byte(buffer, ref pos)) return null; items.Add(item); } return items; }