public void FireStepRequest(string Message) { if (!skipLog) { lock (eventConsumer) { eventConsumer.FireStepRequest(Message); } } }
public static void RegisterCallbacks() { VerifyFilterRegistration(); SharpStepCallback callback = (ObjectId, StepNumber, Type, Text) => { VideoContainer2 v = null; IVideoFormEvent EventConsumer = null; lock (AllContainers) { v = AllContainers[ObjectId]; } if (v != null) { EventConsumer = v.EventConsumer; } try { switch (Type) { case 0: if (EventConsumer != null) { EventConsumer.FireBeginStep(Text); } ; Console.WriteLine("\nFilter = {0}, step{1}: Begin {2}", ObjectId, StepNumber, Text); break; case 1: if (EventConsumer != null) { EventConsumer.FireStepRequest(Text); } ; Console.WriteLine("\nFilter = {0}, step{1}: Send [{2}]", ObjectId, StepNumber, Text); break; case 2: if (EventConsumer != null) { EventConsumer.FireStepResponse(Text); } ; Console.WriteLine("\nFilter = {0}, step{1}: Recv [{2}]", ObjectId, StepNumber, Text); break; case 3: if (EventConsumer != null) { EventConsumer.FireLogStepEvent(Text); } ; Console.WriteLine("\nFilter = {0}, step{1}: Log [{2}]", ObjectId, StepNumber, Text); break; case 4: if (EventConsumer != null) { EventConsumer.FireStepPassed(); } ; Console.WriteLine("\nFilter = {0}, step{1}: Success {2}", ObjectId, StepNumber, Text); break; case 5: v.Failed = true; v.FailedText = Text; //if (EventConsumer != null) { EventConsumer.FireStepFailed(Text); }; Console.WriteLine("\nFilter = {0}, step{1}: Failure {2}", ObjectId, StepNumber, Text); break; default: Console.WriteLine("\nFilter = {0}, step{1}: Undefined type {3}, Text=[{2}]", ObjectId, StepNumber, Text, Type); break; } } catch (Exception ex) { v.Failed = true; v.FailedText = ex.Message; } }; SetGlobalStepCallback(callback); }