private static void TriggerEvent(TileProgressEventHandler evt, object sender, CallbackStates state, MapTilingConfiguration map, string group, int scaleindex, int row, int column, ref bool cancel)
        {
            var args = new TileProgressEventArgs(state, map, group, scaleindex, row, column, cancel);

            evt?.Invoke(sender, args);
            cancel = args.Cancel;
        }
        internal void InvokeFinishRendering(MapTilingConfiguration batchMap, string group, int scaleindex, int row, int col)
        {
            var args = new TileProgressEventArgs(CallbackStates.FinishRenderTile, batchMap, group, scaleindex, row, col, m_cancel);

            this.FinishRenderingTile?.Invoke(this, args);
            m_cancel = args.Cancel;
        }
        internal void InvokeFinishRendering(MapTilingConfiguration batchMap, string group)
        {
            var args = new TileProgressEventArgs(CallbackStates.FinishRenderGroup, batchMap, group, -1, -1, -1, m_cancel);

            this.FinishRenderingGroup?.Invoke(this, args);
            m_cancel = args.Cancel;
        }
        internal void InvokeBeginRendering(MapTilingConfiguration batchMap, string group, int scaleindex)
        {
            var args = new TileProgressEventArgs(CallbackStates.StartRenderScale, batchMap, group, scaleindex, -1, -1, m_cancel);

            this.BeginRenderingScale?.Invoke(this, args);
            m_cancel = args.Cancel;
            PauseEvent.WaitOne();
        }
        internal void InvokeBeginRendering(MapTilingConfiguration batchMap)
        {
            var args = new TileProgressEventArgs(CallbackStates.StartRenderMap, batchMap, null, -1, -1, -1, m_cancel);

            this.BeginRenderingMap?.Invoke(this, args);
            m_cancel = args.Cancel;
            PauseEvent.WaitOne();
        }