Пример #1
0
        ///////////////////////////////////////////////////////////////////////////////////////////////

        #region Dead Code
#if DEAD_CODE
        private static DialogResult Complain( /* NOT USED */
            ReturnCode code,
            Result result
            )
        {
            return(Complain(ResultOps.Format(code, result)));
        }
Пример #2
0
        ///////////////////////////////////////////////////////////////////////

        #region Background Error Reporter
        private static void ReportBackgroundError(
            Interpreter interpreter,
            string handlerName,
            string description0,
            string description1,
            ReturnCode code1,
            Result result1,
            int errorLine1,
            string description2,
            ReturnCode code2,
            Result result2,
            int errorLine2
            )
        {
            bool[] haveDescription =
            {
                !String.IsNullOrEmpty(description0),
                !String.IsNullOrEmpty(description1),
                !String.IsNullOrEmpty(description2)
            };

            Result bgReport = String.Concat(
                haveDescription[0] ?
                String.Format(description0,
                              FormatOps.WrapOrNull(handlerName)) :
                String.Empty, haveDescription[0] ?
                Environment.NewLine : String.Empty,
                haveDescription[1] ?
                String.Format("{0}{1}: {2}", haveDescription[0] ?
                              BackgroundErrorDetailIndent : String.Empty,
                              description1,
                              ResultOps.Format(code1,
                                               result1, errorLine1, false, true)) :
                String.Empty, haveDescription[1] ?
                Environment.NewLine : String.Empty,
                haveDescription[2] ?
                String.Format("{0}{1}: {2}", haveDescription[0] ?
                              BackgroundErrorDetailIndent : String.Empty,
                              description2,
                              ResultOps.Format(code2,
                                               result2, errorLine2, false, true)) :
                String.Empty, haveDescription[2] ?
                Environment.NewLine : String.Empty);

            //
            // TODO: Something else here as well?
            //
            if ((bgReport != null) && !String.IsNullOrEmpty(bgReport))
            {
                DebugOps.Complain(interpreter, code2, bgReport);
            }
        }