本文整理汇总了C#中DigitalPlatform.Stop.HideProgress方法的典型用法代码示例。如果您正苦于以下问题:C# Stop.HideProgress方法的具体用法?C# Stop.HideProgress怎么用?C# Stop.HideProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DigitalPlatform.Stop
的用法示例。
在下文中一共展示了Stop.HideProgress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: menu_printHtml_Click
//.........这里部分代码省略.........
{
stop.SetProgressRange(0, this.listView_records.SelectedItems.Count);
int i = 0;
foreach (ListViewItem item in this.listView_records.SelectedItems)
{
Application.DoEvents();
if (stop != null && stop.State != 0)
{
strError = "用户中断";
goto ERROR1;
}
OperLogItemInfo info = (OperLogItemInfo)item.Tag;
string strLogFileName = ListViewUtil.GetItemText(item, COLUMN_FILENAME);
string strIndex = ListViewUtil.GetItemText(item, COLUMN_INDEX);
string strXml = "";
// 从服务器获得
// return:
// -1 出错
// 0 正常
// 1 用户中断
int nRet = GetXml(item,
out strXml,
out strError);
if (nRet == 1)
return;
if (nRet == -1)
goto ERROR1;
Global.SetXmlString(this.webBrowser_xml,
strXml,
this.MainForm.DataDir,
"operlogexml");
string strHtml = "";
// 创建解释日志记录内容的 HTML 字符串
// return:
// -1 出错
// 0 成功
// 1 未知的操作类型
nRet = GetHtmlString(strXml,
false,
out strHtml,
out strError);
if (nRet == -1)
goto ERROR1;
if (nRet == 1)
strHtml = strError;
StreamUtil.WriteText(strFilename,
"<p class='record_title'>" + strLogFileName + " : " + strIndex + "</p>" + strHtml);
stop.SetProgressValue(i + 1);
i++;
}
}
finally
{
this.GetSummary -= new GetSummaryEventHandler(OperLogForm_GetSummary);
if (m_webExternalHost != null)
{
m_webExternalHost.IsInLoop = false;
m_webExternalHost.Destroy();
m_webExternalHost = null;
}
stop.EndLoop();
stop.OnStop -= new StopEventHandler(this.DoStopPrint);
stop.Initial("打印页面创建完成");
stop.HideProgress();
if (stop != null) // 脱离关联
{
stop.Unregister(); // 和容器关联
stop = null;
}
}
StreamUtil.WriteText(strFilename,
"</body></html>");
// TODO: 浏览器控件连接javascript host
HtmlPrintForm printform = new HtmlPrintForm();
printform.Text = "打印解释内容";
printform.MainForm = this.MainForm;
printform.Filenames = filenames;
this.MainForm.AppInfo.LinkFormState(printform, "operlogform_printform_state");
printform.ShowDialog(this);
this.MainForm.AppInfo.UnlinkFormState(printform);
return;
ERROR1:
MessageBox.Show(this, strError);
}
示例2: ProcessSelectedRecords
int ProcessSelectedRecords(Delegate_processLog func,
out string strError)
{
strError = "";
if (this.listView_records.SelectedItems.Count == 0)
{
strError = "尚未选定要处理的行";
return -1;
}
Stop stop = new DigitalPlatform.Stop();
stop.Register(MainForm.stopManager, true); // 和容器关联
stop.OnStop += new StopEventHandler(this.DoStopPrint);
stop.Initial("正在处理日志记录 ...");
stop.BeginLoop();
try
{
stop.SetProgressRange(0, this.listView_records.SelectedItems.Count);
int i = 0;
foreach (ListViewItem item in this.listView_records.SelectedItems)
{
Application.DoEvents();
if (stop != null && stop.State != 0)
{
strError = "用户中断";
return -1;
}
OperLogItemInfo info = (OperLogItemInfo)item.Tag;
string strLogFileName = ListViewUtil.GetItemText(item, COLUMN_FILENAME);
string strIndex = ListViewUtil.GetItemText(item, COLUMN_INDEX);
string strXml = "";
// 从服务器获得
// return:
// -1 出错
// 0 正常
// 1 用户中断
int nRet = GetXml(item,
out strXml,
out strError);
if (nRet == 1)
return -1;
if (nRet == -1)
return -1;
XmlDocument dom = new XmlDocument();
try
{
dom.LoadXml(strXml);
}
catch (Exception ex)
{
strError = "装载日志记录 '" + strLogFileName + ":" + strIndex + "' XML 到 DOM 时发生错误: " + ex.Message;
return -1;
}
if (func != null)
{
if (func(strLogFileName,
Convert.ToInt32(strIndex),
dom,
null) == false)
break;
}
stop.SetProgressValue(i + 1);
i++;
}
return 0;
}
finally
{
stop.EndLoop();
stop.OnStop -= new StopEventHandler(this.DoStopPrint);
stop.Initial("处理完成");
stop.HideProgress();
if (stop != null) // 脱离关联
{
stop.Unregister(); // 和容器关联
stop = null;
}
}
}