public override void Execute(INotification notification) { UserNote note = notification as UserNote; if (note != null) { this.ExecuteNote(note); } else { if (notification.Name == Application.APPSTART) { StartShipServer(); } else if (notification.Name == Application.APPSTOP) { if (server != null) { server.Stop(); server = null; } } } }
private void StartShipServer() { var add = ConfigLoader.Config.EpShip; if (add != null) { try { if (server != null) { server.Stop(); server = null; } } catch { } server = ConfigLoader.Config.Platform == "tencent" ? new ShipmentServer() : new ShipmentServerQY(); server.Start(add); } }