internal void CacheDocumentation(string docFilePath, IWarningsCollector warnings)
        {
            if (string.IsNullOrEmpty(docFilePath))
            {
                return;
            }
            if (!File.Exists(docFilePath))
            {
                warnings.AddWarning(ErrorMessages.RTW0002_DocumentationNotFound.Warn(docFilePath));
                return;
            }
            try
            {
                var ser = new XmlSerializer(typeof(Documentation));

                Documentation documentation;
                using (var fs = File.OpenRead(docFilePath))
                {
                    documentation = (Documentation)ser.Deserialize(fs);
                }
                foreach (var documentationMember in documentation.Members)
                {
                    _documentationCache[documentationMember.Name] = documentationMember;
                }
                _isDocumentationExists = true;
            }
            catch (Exception ex)
            {
                _isDocumentationExists = false;
                warnings.AddWarning(ErrorMessages.RTW0006_DocumentationParseringError.Warn(docFilePath, ex.Message));
            }
        }
 internal DocumentationManager(string[] docFilePath, IWarningsCollector warnings)
 {
     foreach (var s in docFilePath)
     {
         CacheDocumentation(s, warnings);
     }
 }
Пример #3
0
 internal static IEnumerable <Type> _GetTypes(this Assembly a, IWarningsCollector warnings)
 {
     try
     {
         return(a.GetTypes());
     }
     catch (ReflectionTypeLoadException e)
     {
         foreach (var elo in e.LoaderExceptions)
         {
             warnings.AddWarning(ErrorMessages.RTW0008_TypeloadException.Warn(elo.Message));
         }
         return(e.Types.Where(t => t != null));
     }
 }
 internal DocumentationManager(string docFilePath, IWarningsCollector warnings)
 {
     CacheDocumentation(docFilePath, warnings);
 }
Пример #5
0
 public PersonQueryHandler(Queryable <BaPerson> personen, IWarningsCollector warningsCollector)
 {
     _personen          = personen;
     _warningsCollector = warningsCollector;
 }
 public WriteWarningsToResponseMiddleware(IWarningsCollector warningsCollector)
 {
     _warningsCollector = warningsCollector;
 }