public IndexMaintainerWrapper(IndexConfig indexConfig, CodeIndexConfiguration codeIndexConfiguration, ILogger log)
        {
            indexConfig.RequireNotNull(nameof(indexConfig));
            codeIndexConfiguration.RequireNotNull(nameof(codeIndexConfiguration));
            log.RequireNotNull(nameof(log));

            Maintainer  = new IndexMaintainer(indexConfig, codeIndexConfiguration, log);
            IndexConfig = indexConfig;
        }
示例#2
0
        public static IndexConfigForView GetIndexConfigForView(IndexConfig indexConfig)
        {
            indexConfig.RequireNotNull(nameof(indexConfig));

            return(new IndexConfigForView
            {
                MaxContentHighlightLength = indexConfig.MaxContentHighlightLength,
                SaveIntervalSeconds = indexConfig.SaveIntervalSeconds,
                OpenIDEUriFormat = indexConfig.OpenIDEUriFormat,
                MonitorFolderRealPath = indexConfig.MonitorFolderRealPath,
                IndexName = indexConfig.IndexName,
                Pk = indexConfig.Pk
            });
        }
示例#3
0
        public IndexMaintainer(IndexConfig indexConfig, CodeIndexConfiguration codeIndexConfiguration, ILogger log)
        {
            indexConfig.RequireNotNull(nameof(indexConfig));
            codeIndexConfiguration.RequireNotNull(nameof(codeIndexConfiguration));
            log.RequireNotNull(nameof(log));

            IndexConfig            = indexConfig;
            CodeIndexConfiguration = codeIndexConfiguration;
            Log    = log;
            Status = IndexStatus.Idle;

            ExcludedExtensions = indexConfig.ExcludedExtensionsArray.Select(u => u.ToUpperInvariant()).ToArray();
            ExcludedPaths      = FilePathHelper.GetPaths(indexConfig.ExcludedPathsArray, codeIndexConfiguration.IsInLinux);
            IncludedExtensions = indexConfig.IncludedExtensionsArray.Select(u => u.ToUpperInvariant()).ToArray() ?? Array.Empty <string>();
            TokenSource        = new CancellationTokenSource();
        }
示例#4
0
 public IndexStatusInfo(IndexStatus indexStatus, IndexConfig indexConfig)
 {
     indexConfig.RequireNotNull(nameof(indexConfig));
     IndexStatus = indexStatus;
     IndexConfig = indexConfig;
 }