本文整理汇总了C#中DigitalPlatform.rms.Client.RmsChannel.DoTest方法的典型用法代码示例。如果您正苦于以下问题:C# RmsChannel.DoTest方法的具体用法?C# RmsChannel.DoTest怎么用?C# RmsChannel.DoTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DigitalPlatform.rms.Client.RmsChannel
的用法示例。
在下文中一共展示了RmsChannel.DoTest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button_test_Click
private void button_test_Click(object sender, EventArgs e)
{
#if NO
textBox_simpleQuery_comment.Text = "";
// 第一阶段
TargetItemCollection targets = treeView_simpleQueryResTree.
GetSearchTarget();
Debug.Assert(targets != null, "GetSearchTarget() 异常");
int i;
// 第二阶段
for (i = 0; i < targets.Count; i++)
{
TargetItem item = (TargetItem)targets[i];
item.Words = textBox_simpleQueryWord.Text;
}
targets.MakeWordPhrases(
Convert.ToBoolean(MainForm.applicationInfo.GetInt("simple_query_property", "auto_split_words", 1)),
Convert.ToBoolean(MainForm.applicationInfo.GetInt("simple_query_property", "auto_detect_range", 0)),
Convert.ToBoolean(MainForm.applicationInfo.GetInt("simple_query_property", "auto_detect_relation", 0))
);
// 参数
for (i = 0; i < targets.Count; i++)
{
TargetItem item = (TargetItem)targets[i];
item.MaxCount = MainForm.applicationInfo.GetInt("simple_query_property", "maxcount", -1);
}
// 第三阶段
targets.MakeXml();
// 正式检索
string strError;
if (bOutputKeyID == true)
this.m_bFirstColumnIsKey = true;
else
this.m_bFirstColumnIsKey = false;
this.ClearListViewPropertyCache();
this.ClearListViewItems();
stop.OnStop += new StopEventHandler(this.DoStop);
stop.Initial("正在Test ...");
stop.BeginLoop();
EnableControlsInSearching(true);
long lTotalCount = 0; // 命中记录总数
for (i = 0; i < targets.Count; i++)
{
if (stop.State >= 1)
break;
TargetItem item = (TargetItem)targets[i];
channel = Channels.GetChannel(item.Url);
Debug.Assert(channel != null, "Channels.GetChannel 异常");
textBox_simpleQuery_comment.Text += "检索式XML:\r\n" + item.Xml + "\r\n";
// MessageBox.Show(this, item.Xml);
long nRet = channel.DoTest(item.Xml);
if (nRet == -1)
{
textBox_simpleQuery_comment.Text += "Test出错: \r\n";
MessageBox.Show(this, textBox_simpleQuery_comment.Text);
continue;
}
lTotalCount += nRet;
textBox_simpleQuery_comment.Text += "命中记录数: " + Convert.ToString(nRet) + "\r\n";
}
if (targets.Count > 1)
{
textBox_simpleQuery_comment.Text += "命中总条数: " + Convert.ToString(lTotalCount) + "\r\n";
}
stop.EndLoop();
stop.OnStop -= new StopEventHandler(this.DoStop);
stop.Initial("");
EnableControlsInSearching(false);
channel = null;
#endif
}