private static void ExecuteOnMainProcess(Action action, bool doAsync) { ICommService service = GetChannel(); if (service == null || service.ExecuteOnMainProcess(DelToByte(action), doAsync)) { action(); } }