当前位置: 首页>>代码示例>>C#>>正文


C# RmsChannel.DoBrowse方法代码示例

本文整理汇总了C#中DigitalPlatform.rms.Client.RmsChannel.DoBrowse方法的典型用法代码示例。如果您正苦于以下问题:C# RmsChannel.DoBrowse方法的具体用法?C# RmsChannel.DoBrowse怎么用?C# RmsChannel.DoBrowse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DigitalPlatform.rms.Client.RmsChannel的用法示例。


在下文中一共展示了RmsChannel.DoBrowse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoXmlSearch

		public void DoXmlSearch(bool bOutputKeyID)
		{
            textBox_xmlQuery_comment.Text = "";

			// 第一阶段
			TargetItemCollection targets = treeView_simpleQueryResTree.
				GetSearchTarget();
			Debug.Assert(targets != null, "GetSearchTarget() 异常");

			// 正式检索
			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("正在检索 ...");
			stop.BeginLoop();

			EnableControlsInSearching(true);

            // 2010/5/18
            string strBrowseStyle = "id,cols";
            string strOutputStyle = "";
            if (bOutputKeyID == true)
            {
                strOutputStyle = "keyid";
                strBrowseStyle = "keyid,id,key,cols";
            }

			long lTotalCount = 0;	// 命中记录总数
			for(int 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 异常");

				// MessageBox.Show(this, item.Xml);
				long nRet = channel.DoSearch(textBox_xmlQueryString.Text,
                    "default",
                    strOutputStyle,
                    out strError);
				if (nRet == -1) 
				{
                    textBox_xmlQuery_comment.Text += "出错: " + strError + "\r\n";
					MessageBox.Show(this, strError);
					continue;
				}
				lTotalCount += nRet;
				textBox_xmlQuery_comment.Text += "命中记录数: " + Convert.ToString(nRet) + "\r\n";

				if (nRet == 0)
					continue;

				// 获取结果集

				nRet = channel.DoBrowse(listView_browse,
					listView_browse.Lang,
					stop,
                    "default",
                    strBrowseStyle,
					out strError);
				if (nRet == -1) 
				{
                    textBox_xmlQuery_comment.Text += "装载浏览信息时出错: " + strError + "\r\n";
					MessageBox.Show(this, strError);
					continue;
				}

			}

			if (targets.Count > 1) 
			{
                textBox_xmlQuery_comment.Text += "命中总条数: " + Convert.ToString(lTotalCount) + "\r\n";
			}

			stop.EndLoop();
            stop.OnStop -= new StopEventHandler(this.DoStop);
			stop.Initial("");

			if (lTotalCount == 0) 
			{
				MessageBox.Show(this, "未命中");
			}

			EnableControlsInSearching(false);

			channel = null;

		}
开发者ID:paopaofeng,项目名称:dp2,代码行数:99,代码来源:SearchForm.cs

示例2: DoComplexSearch

		// 复杂检索
		public void DoComplexSearch(bool bOutputKeyID)
		{
			textBox_complexQuery_comment.Text = "";

			ArrayList aServer = null;
			ArrayList aQueryXml = null;
			string strError = "";

			long nRet = BuildQueryXml(
				out aServer,
				out aQueryXml,
				out strError);
			if (nRet == -1)
			{
				MessageBox.Show(strError);
				return;
			}

			if (aServer.Count == 0)
			{
				MessageBox.Show("因没有选定任何服务器地址,无法进行检索");
				return;
			}

			// 正式检索

			// 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("正在检索 ...");
			stop.BeginLoop();

			EnableControlsInSearching(true);

            // 2010/5/18
            string strBrowseStyle = "id,cols";
            string strOutputStyle = "";
            if (bOutputKeyID == true)
            {
                strOutputStyle = "keyid";
                strBrowseStyle = "keyid,id,key,cols";
            }

			long lTotalCount = 0;	// 命中记录总数
			int i=0;
			for(i=0;i<aServer.Count;i++)
			{

				if (stop.State >= 1)
					break;

				string strServer = (string)aServer[i];
				string strQueryXml = (string)aQueryXml[i];

				channel = Channels.GetChannel(strServer);
				Debug.Assert(channel != null, "Channels.GetChannel 异常");
				textBox_complexQuery_comment.Text += "目标服务器:\t" + strServer + "\r\n";

				textBox_complexQuery_comment.Text += "检索式XML:\r\n" + DomUtil.GetIndentXml(strQueryXml) + "\r\n";

				// MessageBox.Show(this, item.Xml);
				nRet = channel.DoSearch(strQueryXml,
                    "default",
                    strOutputStyle,
                    out strError);
				if (nRet == -1) 
				{
					textBox_complexQuery_comment.Text += "出错: " + strError + "\r\n";
					MessageBox.Show(this, strError);
					continue;
				}
				lTotalCount += nRet;
				textBox_complexQuery_comment.Text += "命中记录数: " + Convert.ToString(nRet) + "\r\n";

				if (nRet == 0)
					continue;

				// 获取结果集

				nRet = channel.DoBrowse(listView_browse,
					listView_browse.Lang,
					stop,
                    "default",
                    strBrowseStyle,
					out strError);
				if (nRet == -1) 
				{
					textBox_complexQuery_comment.Text += "装载浏览信息时出错: " + strError + "\r\n";
					MessageBox.Show(this, strError);
					continue;
				}
			}
//.........这里部分代码省略.........
开发者ID:paopaofeng,项目名称:dp2,代码行数:101,代码来源:SearchForm.cs

示例3: DoSimpleSearch

		public void DoSimpleSearch(bool bOutputKeyID)
		{
			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.AppInfo.GetInt("simple_query_property", "auto_split_words", 1)),
				Convert.ToBoolean( MainForm.AppInfo.GetInt("simple_query_property", "auto_detect_range", 0) ),
				Convert.ToBoolean( MainForm.AppInfo.GetInt("simple_query_property", "auto_detect_relation", 0) )
				);


			// 参数
			for(i=0;i<targets.Count;i++)
			{
				TargetItem item = (TargetItem)targets[i];
				item.MaxCount = MainForm.AppInfo.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("正在检索 ...");
			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" + DomUtil.GetIndentXml(item.Xml) + "\r\n";

                // 2010/5/18
                string strBrowseStyle = "id,cols";
                string strOutputStyle = "";
                if (bOutputKeyID == true)
                {
                    strOutputStyle = "keyid";
                    strBrowseStyle = "keyid,id,key,cols";
                }

				// MessageBox.Show(this, item.Xml);
				long nRet = channel.DoSearch(item.Xml,
                    "default",
                    strOutputStyle,
                    out strError);
				if (nRet == -1) 
				{
					textBox_simpleQuery_comment.Text += "出错: " + strError + "\r\n";
					MessageBox.Show(this, strError);
					continue;
				}
				lTotalCount += nRet;
				textBox_simpleQuery_comment.Text += "命中记录数: " + Convert.ToString(nRet) + "\r\n";

				if (nRet == 0)
					continue;

				// 获取结果集
				nRet = channel.DoBrowse(listView_browse,
					listView_browse.Lang,
					stop,
                    "default",
                    strBrowseStyle,
                    out strError);
				if (nRet == -1) 
//.........这里部分代码省略.........
开发者ID:paopaofeng,项目名称:dp2,代码行数:101,代码来源:SearchForm.cs


注:本文中的DigitalPlatform.rms.Client.RmsChannel.DoBrowse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。