Пример #1
0
 public override ProcessingMessage Register(ProcessingErrorCode code, Severity severity, ObjectType objectType, string objectName, string propertyName, ProcessingMessageList innerMessages, params string[] arguments)
 {
     try
     {
         Monitor.Enter(this);
         if (severity == Severity.Error)
         {
             base.m_hasError = true;
         }
         if (this.RegisterItem(severity, code, objectType, objectName))
         {
             if (base.m_messages == null)
             {
                 base.m_messages = new ProcessingMessageList();
             }
             ProcessingMessage processingMessage = ErrorContext.CreateProcessingMessage(code, severity, objectType, objectName, propertyName, innerMessages, arguments);
             base.m_messages.Add(processingMessage);
             return(processingMessage);
         }
         return(null);
     }
     finally
     {
         Monitor.Exit(this);
     }
 }
Пример #2
0
 private static string CodeFromMessage(ProcessingMessage message)
 {
     if (message.Code == ProcessingErrorCode.rsNone)
     {
         return(message.CommonCode.ToString());
     }
     return(message.Code.ToString());
 }
        private void ResolveAssemblylocations(StringList codeModules, CompilerParameters options, ErrorContext errorContext, AppDomain compilationTempAppDomain)
        {
            AssemblyLocationResolver assemblyLocationResolver = AssemblyLocationResolver.CreateResolver(compilationTempAppDomain);

            for (int num = codeModules.Count - 1; num >= 0; num--)
            {
                try
                {
                    options.ReferencedAssemblies.Add(assemblyLocationResolver.LoadAssemblyAndResolveLocation(codeModules[num]));
                }
                catch (Exception ex)
                {
                    ProcessingMessage processingMessage = errorContext.Register(ProcessingErrorCode.rsErrorLoadingCodeModule, Severity.Error, ObjectType.Report, null, null, codeModules[num], ex.Message);
                    if (Global.Tracer.TraceError && processingMessage != null)
                    {
                        Global.Tracer.Trace(TraceLevel.Error, processingMessage.Message + Environment.NewLine + ex.ToString());
                    }
                }
            }
        }
Пример #4
0
 public void Combine(ProcessingMessageList messages)
 {
     if (messages != null)
     {
         for (int i = 0; i < messages.Count; i++)
         {
             ProcessingMessage processingMessage = messages[i];
             if (processingMessage.Severity == Severity.Error)
             {
                 base.m_hasError = true;
             }
             if (this.RegisterItem(processingMessage.Severity, processingMessage.Code, processingMessage.ObjectType, processingMessage.ObjectName))
             {
                 if (base.m_messages == null)
                 {
                     base.m_messages = new ProcessingMessageList();
                 }
                 base.m_messages.Add(processingMessage);
             }
         }
     }
 }
Пример #5
0
 public virtual void Register(RSException rsException, ObjectType objectType)
 {
     if (!this.m_suspendErrors)
     {
         this.m_hasError = true;
         if (this.m_messages == null)
         {
             this.m_messages = new ProcessingMessageList();
         }
         ProcessingMessage processingMessage = this.CreateProcessingMessage(rsException.Code, objectType, rsException.Message);
         this.m_messages.Add(processingMessage);
         for (rsException = (rsException.InnerException as RSException); rsException != null; rsException = (rsException.InnerException as RSException))
         {
             ProcessingMessage processingMessage2 = this.CreateProcessingMessage(rsException.Code, objectType, rsException.Message);
             if (processingMessage.ProcessingMessages == null)
             {
                 processingMessage.ProcessingMessages = new ProcessingMessageList(1);
             }
             processingMessage.ProcessingMessages.Add(processingMessage2);
             processingMessage = processingMessage2;
         }
     }
 }