争论与论证不同

时间:2018-04-15 16:33:08

标签: xamarin.forms

这是在构造函数中......

    try Apache POI... http://poi.apache.org/ 

Workbook wb = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet("Java Books");
  // create header row
  HSSFRow headerRow = sheet.createRow(0)
Cell nameHeaderCell = headerRow.createCell(0);
Cell addressHeaderCell = headerRow.createCell(1);

String sql = "select name, address from student";
PrepareStatement ps =  connection.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();    

int row = 1;
while(resultSet.next()) {
    String name = resultSet.getString("name");
    String address = resultSet.getString("address");

    Row dataRow = sheet.createRow(row);

    Cell dataCell = dataRow.createCell(0);
    dataCell.setCellValue(name);

    Cell dataAddressCell = dataRow.createCell(1);
    dataAddressCell.setCellValue(address);

    row = row + 1;
}

String outputDirPath = "";//PATH for export location
FileOutputStream fileOut = new FileOutputStream(outputDirPath);
wb.write(fileOut);
fileOut.close();

这是在同一页面中调用的......

MessagingCenter.Unsubscribe<object, AppointmentDetail>(this, "AppointmentLoaded");
MessagingCenter.Subscribe<object, AppointmentDetail>(this, "AppointmentLoaded", async (sender, a) =>
{
    if (appointment.AppointmentId == a.AppointmentId && appointment != a) // a member property
    {
        ...
    }
});

调用处理函数,随通知发送的约会与到达处理程序的约会不同。

这怎么可能?

此外,即使邮件只发送一次,处理程序也会运行两次

有什么想法吗?

如果我在发送消息时设置断点,则它会正确运行。所以我猜测那里有一些调试工具。

1 个答案:

答案 0 :(得分:0)

这种情况正在发生,因为我创建了两个页面,一个是登录过程的一侧,第一个页面仍在接收消息。