Esempio n. 1
0
        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;
        }
Esempio n. 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
            });
        }
Esempio n. 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();
        }
Esempio n. 4
0
 public IndexStatusInfo(IndexStatus indexStatus, IndexConfig indexConfig)
 {
     indexConfig.RequireNotNull(nameof(indexConfig));
     IndexStatus = indexStatus;
     IndexConfig = indexConfig;
 }