代码着色功能小改进

改进后的效果如下:
using System;
using Dottext.Framework.Logger;

namespace Dottext.Search
{
    
/// <summary>
    
/// IndexQueue 的摘要说明。
    
/// </summary>

    public class IndexQueue
    
{
        
public IndexQueue()
        
{
            
        }


        
public void Run(object state)
        
{
            
string path = SearchConfiguration.Instance().PhysicalPath;
            
string tempIndex = System.IO.Path.Combine(path,SearchConfiguration.TempIndex);
            
if(System.IO.File.Exists(tempIndex+"\segments"))
            
{
                LogManager.Log(
"IndexQueue Abort","Another RebuildSafeIndex is Runing");
                
return;
            }

            Log log 
= new Log();
            log.Title 
= "Search Index";
            log.Message 
= string.Format("Manual Build");
            IndexManager.RebuildSafeIndex();
            log.EndDate 
= DateTime.Now;
            LogManager.Create(log);
            
        }

    }

}

原文地址:https://www.cnblogs.com/dudu/p/20325.html