Пример #1
0
        public static void OnPlanEvent(ZeroNetEventType eventType, ZeroPlan plan)
        {
            switch (eventType)
            {
            case ZeroNetEventType.PlanAdd:
                SyncPlan(plan);
                break;

            case ZeroNetEventType.PlanRemove:
                RemovePlan(plan);
                break;

            default:
                UpdatePlan(plan);
                break;
            }
        }
Пример #2
0
        /// <summary>
        ///     收到信息的处理
        /// </summary>
        private static void OnMessagePush(ZeroNetEventType zeroNetEvent, string station, string content)
        {
            switch (zeroNetEvent)
            {
            case ZeroNetEventType.CenterSystemStart:
                center_start(content);
                return;

            case ZeroNetEventType.CenterSystemClosing:
                center_closing(content);
                return;

            case ZeroNetEventType.CenterSystemStop:
                center_stop(content);
                return;

            case ZeroNetEventType.CenterWorkerSoundOff:
                worker_sound_off();
                return;
            }
            if (!ZeroApplication.InRun)
            {
                return;
            }
            switch (zeroNetEvent)
            {
            case ZeroNetEventType.CenterStationState:
                station_state(station, content);
                return;

            case ZeroNetEventType.CenterStationInstall:
                station_install(station, content);
                return;

            case ZeroNetEventType.CenterStationUpdate:
                station_update(station, content);
                return;

            case ZeroNetEventType.CenterStationJoin:
                station_join(station, content);
                return;

            case ZeroNetEventType.CenterStationPause:
                station_pause(station);
                return;

            case ZeroNetEventType.CenterStationResume:
                station_resume(station);
                return;

            case ZeroNetEventType.CenterStationClosing:
                station_closing(station);
                return;

            case ZeroNetEventType.CenterStationLeft:
                station_left(station);
                return;

            case ZeroNetEventType.CenterStationStop:
                station_stop(station);
                return;

            case ZeroNetEventType.CenterStationRemove:
                station_uninstall(station);
                return;

            case ZeroNetEventType.CenterStationDocument:
                station_document(station, content);
                return;

            case ZeroNetEventType.CenterClientJoin:
                client_join(station, content);
                return;

            case ZeroNetEventType.CenterClientLeft:
                client_left(station, content);
                return;
            }
        }
Пример #3
0
 /// <summary>
 /// 构造
 /// </summary>
 /// <param name="centerEvent"></param>
 /// <param name="context"></param>
 /// <param name="config"></param>
 public ZeroNetEventArgument(ZeroNetEventType centerEvent, string context, StationConfig config)
 {
     EventConfig = config;
     Event       = centerEvent;
     Context     = context;
 }