AssemblyDescriptor.DesignExt.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using FastReport.Utils;
  2. #if NETSTANDARD || NETCOREAPP
  3. using FastReport.Code.CodeDom.Compiler;
  4. #else
  5. using System.CodeDom.Compiler;
  6. #endif
  7. using System.Collections.Generic;
  8. using System.Collections.Specialized;
  9. using System.IO;
  10. namespace FastReport.Code
  11. {
  12. partial class AssemblyDescriptor
  13. {
  14. private void ErrorMsg(CompilerError ce, int line)
  15. {
  16. if (Report.Designer != null)
  17. Report.Designer.ErrorMsg(Res.Get("Messages,Error") + " " + ce.ErrorNumber + ": " + ce.ErrorText, line, ce.Column);
  18. }
  19. private void ErrorMsg(string errObjName, CompilerError ce)
  20. {
  21. if (Report.Designer != null)
  22. Report.Designer.ErrorMsg(errObjName + ": " + Res.Get("Messages,Error") + " " + ce.ErrorNumber + ": " + ce.ErrorText, errObjName);
  23. }
  24. private void ErrorMsg(string msg)
  25. {
  26. if (Report.Designer != null)
  27. Report.Designer.ErrorMsg(msg, null);
  28. }
  29. private void ReviewReferencedAssemblies(StringCollection assemblies)
  30. {
  31. #if COMMUNITY
  32. List<string> replace = new List<string>();
  33. foreach (string str in assemblies)
  34. {
  35. if (str.ToLower().EndsWith("fastreport.dll"))
  36. replace.Add(str);
  37. }
  38. foreach (string str in replace)
  39. {
  40. if (assemblies.Contains(str))
  41. assemblies.Remove(str);
  42. }
  43. string fastreport_path = Path.Combine(Config.GetTempFolder(), "TopRafters42.dll");
  44. assemblies.Add(fastreport_path);
  45. #endif
  46. }
  47. }
  48. }