This paper proposes a system-wide optimal coordinated energy dispatch method for a multi-energy microgrid in both the grid-connected and islanded modes. The studied microgrid consists of multiple energy carriers covering the controllable generation units (fuel cell, electric boiler, combined cooling, heat and power plant and electric chiller), uncontrollable generation units (wind turbine and photovoltaic cell) and energy storage devices (battery storage, heat storage tank and ice storage tank). The proposed energy dispatch method aims to minimize the microgrid net operating cost and enhance the dispatch flexibility in supplying power, heat and cooling in the day-ahead energy market. For both the grid-connected and islanded microgrid, their dispatch models are formulated as the mixed-integer linear programming problems, which can be efficiently solved by the commercial solvers. Comprehensive case studies are performed to evaluate the effectiveness of the proposed method and then compared with the traditional dispatch methods which supply power and heat/cooling energies separately. Simulation results demonstrate that the proposed method can achieve much higher operating efficiency.