/////////////////////////////////////////////////////////////////////// public override bool WriteError( string value, bool newLine ) { CheckDisposed(); try { if (newLine) { DebugOps.TraceWriteLine(value); } else { DebugOps.TraceWrite(value); } return(true); } catch { return(false); } }
/////////////////////////////////////////////////////////////////////// public override bool WriteErrorLine() { CheckDisposed(); try { DebugOps.TraceWriteLine(null); return(true); } catch { return(false); } }
/////////////////////////////////////////////////////////////////////// #region INotify Members public override ReturnCode Notify( Interpreter interpreter, IScriptEventArgs eventArgs, IClientData clientData, ArgumentList arguments, ref Result result ) { // // NOTE: If we are disabled -OR- there are no event arguments -OR- // this event does not match the kind we are interested in // then just return "success" now. // if (disabled || (eventArgs == null) || !FlagOps.HasFlags( eventArgs.NotifyTypes, NotifyType.Engine, false) || !FlagOps.HasFlags( eventArgs.NotifyFlags, NotifyFlags.Executed, false)) { return(ReturnCode.Ok); } // // NOTE: In "direct" mode, skip [almost] all the tracing ceremony // and just call into Trace.WriteLine(). Otherwise, use the // TraceOps class and all its special handling. Either way, // figure out the String.Format() arguments ahead of time, // based on our current "normalize" and "ellipsis" settings. // try { string arg0 = FormatOps.WrapTraceOrNull( normalizeArguments, ellipsisArguments, quoteArguments, displayArguments, eventArgs.Arguments); string arg1 = FormatOps.WrapTraceOrNull( normalizeResult, ellipsisResult, quoteResult, displayResult, eventArgs.Result); if (direct) { // // NOTE: This is just an extremely thin wrapper around // the Trace.WriteLine method. // DebugOps.TraceWriteLine(String.Format( directFormat, arg0, arg1), directCategory); } else { // // NOTE: Use the tracing subsystem. // TraceOps.DebugTrace(String.Format( normalFormat, arg0, arg1), normalCategory, TracePriority.EngineDebug); } return(ReturnCode.Ok); } catch (Exception e) { TraceOps.DebugTrace( e, typeof(Trace).Name, TracePriority.EngineError); result = e; return(ReturnCode.Error); } }