OperationFinished

EventHub.OperationFinished event

索引操作完成时发生。

public event EventHandler<OperationFinishedEventArgs> OperationFinished;

例子

该示例演示了如何使用事件。

string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";

// 创建索引
Index index = new Index(indexFolder);

// 订阅事件
index.Events.OperationFinished += (sender, args) =>
{
    Console.WriteLine("Operation finished: " + args.OperationType);
    Console.WriteLine("Message: " + args.Message);
    Console.WriteLine("Index folder: " + args.IndexFolder);
    Console.WriteLine("Time: " + args.Time);
};

// 索引指定文件夹中的文档
index.Add(documentsFolder);

也可以看看