本文整理汇总了C#中WaitDialogForm类的典型用法代码示例。如果您正苦于以下问题:C# WaitDialogForm类的具体用法?C# WaitDialogForm怎么用?C# WaitDialogForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WaitDialogForm类属于命名空间,在下文中一共展示了WaitDialogForm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddData
/// <summary>
/// 加载数据同时保存数据到指定位置
/// </summary>
/// <param name="obj"></param>
private void AddData(FarPoint.Win.Spread.FpSpread obj)
{
wait = new WaitDialogForm("", "正在加载数据, 请稍候...");
try
{
//打开Excel表格
//清空工作表
fpSpread1.Sheets.Clear();
obj.OpenExcel(System.Windows.Forms.Application.StartupPath + "\\xls\\中压配电网分析.xls");
PF.SpreadRemoveEmptyCells(obj);
//this.AddCellChanged();
//this.barEditItem2.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
//S4_2_1.AddBarEditItems(this.barEditItem2, this.barEditItem1, this);
}
catch (System.Exception e)
{
//如果打开出错则重新生成并保存
LoadData();
//判断文件夹是否存在,不存在则创建
if (!Directory.Exists(System.Windows.Forms.Application.StartupPath + "\\xls"))
{
Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\xls");
}
//保存EXcel文件
obj.SaveExcel(System.Windows.Forms.Application.StartupPath + "\\xls\\中压配电网分析.xls", FarPoint.Excel.ExcelSaveFlags.NoFlagsSet);
// 定义要使用的Excel 组件接口
// 定义Application 对象,此对象表示整个Excel 程序
Microsoft.Office.Interop.Excel.Application excelApp = null;
// 定义Workbook对象,此对象代表工作薄
Microsoft.Office.Interop.Excel.Workbook workBook;
// 定义Worksheet 对象,此对象表示Execel 中的一张工作表
Microsoft.Office.Interop.Excel.Worksheet ws = null;
Microsoft.Office.Interop.Excel.Range range = null;
excelApp = new Microsoft.Office.Interop.Excel.Application();
string filename = System.Windows.Forms.Application.StartupPath + "\\xls\\中压配电网分析.xls";
workBook = excelApp.Workbooks.Open(filename, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
for (int i = 1; i <= workBook.Worksheets.Count; i++)
{
ws = (Microsoft.Office.Interop.Excel.Worksheet)workBook.Worksheets[i];
//取消保护工作表
ws.Unprotect(Missing.Value);
//有数据的行数
int row = ws.UsedRange.Rows.Count;
//有数据的列数
int col = ws.UsedRange.Columns.Count;
//创建一个区域
range = ws.get_Range(ws.Cells[1, 1], ws.Cells[row, col]);
//设区域内的单元格自动换行
range.WrapText = true;
//保护工作表
ws.Protect(Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
}
//保存工作簿
workBook.Save();
//关闭工作簿
excelApp.Workbooks.Close();
}
wait.Close();
}
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:64,代码来源:FrmMediumVoltageDistributionNetworkParsing.cs
示例2: SaveFile
/// <summary>
/// 下载文件
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public static bool SaveFile(byte[] byt,string type)
{
bool result = false;
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "文件类型|*" + type;
if (sfd.ShowDialog() == DialogResult.OK)
{
WaitDialogForm wait = new WaitDialogForm("", "正在下载数据, 请稍候...");
try
{
GetFile(byt, sfd.FileName);
wait.Close();
if (MsgBox.ShowAskMessageBox("下载已完成,是否打开文件?") == DialogResult.OK)
{
try
{
System.Diagnostics.Process.Start(sfd.FileName);
}
catch { System.Diagnostics.Process.Start(sfd.FileName); }
}
}
catch
{
wait.Close();
}
}
return result;
}
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:35,代码来源:CommentHelper.cs
示例3: FileReadDV
public FileReadDV(string projectSUID, string projectid, int dulutype, double ratecaplity, WaitDialogForm wf, string con, StringBuilder dianYaResult)
{
this.projectSUID = projectSUID;
this.projectid = projectid;
this.dulutype = dulutype;
this.ratecaplity = ratecaplity;
this.wf = wf;
this.con = con;
this.dianYaResult = dianYaResult;
}
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:10,代码来源:FileReadDV.cs
示例4: FileReadV
public FileReadV(string projectSUID, string projectid, int dulutype, double ratecaplity, WaitDialogForm wf, bool shortiflag, StringBuilder duanResult)
{
this.projectSUID = projectSUID;
this.projectid = projectid;
this.dulutype = dulutype;
this.ratecaplity = ratecaplity;
this.wf = wf;
this.shortiflag = shortiflag;
this.duanResult = duanResult;
}
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:10,代码来源:FileReadV.cs
示例5: showLoading
public bool showLoading(string message)
{
try
{
dlg = new DevExpress.Utils.WaitDialogForm(message, "โปรแกรมกำลังทำงาน");
dlg.Show();
return true;
}
catch
{
return false;
}
}
开发者ID:ruxchuk,项目名称:TopupAndOrderShop,代码行数:13,代码来源:WaitForLoading.cs
示例6: ValidateConnection
public bool ValidateConnection(XlsFileConnection conn, string fileNamePath, WaitDialogForm wait)
{
if (conn.Open() == null)
{
if (wait != null) wait.Close();
if (conn.ConnectionError == XlsFileErrorCode.NOT_EXCEL_FORMATED)
{
HelpMsgBox.ShowNotificationMessage("Tập tin \"" + fileNamePath + "\" không phải định dạng excel!");
}
else if (conn.ConnectionError == XlsFileErrorCode.PASSWORD_PROTECTED)
{
HelpMsgBox.ShowNotificationMessage("Tập tin \"" + new FileInfo(fileNamePath).Name + "\" đã được bảo vệ bằng mật khẩu!");
}
else
{
HelpMsgBox.ShowNotificationMessage("Truy cập vào tập tin \"" + fileNamePath + "\" không thành công!");
}
return false;
}
return true;
}
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:21,代码来源:frmInLPSKeToan.cs
示例7: DataCheck
public bool DataCheck(string projectSUID)
{
string strCon1 = ",PSP_ELCDEVICE WHERE PSPDEV.SUID = PSP_ELCDEVICE.DeviceSUID AND PSP_ELCDEVICE.ProjectSUID = '" + projectSUID + "'";
string strCon2 = null;
string strCon = null;
{
WaitDialogForm wait = new WaitDialogForm("", "正在处理数据, 请稍候...");
strCon2 = " AND Type = '01'";
strCon = strCon1 + strCon2;
IList listMX = Services.BaseService.GetList("SelectPSPDEVByCondition", strCon);
strCon2 = " AND Type = '05'";
strCon = strCon1 + strCon2;
IList listXL = Services.BaseService.GetList("SelectPSPDEVByCondition", strCon);
strCon2 = " AND Type = '02'";
strCon = strCon1 + strCon2;
IList listBYQ2 = Services.BaseService.GetList("SelectPSPDEVByCondition", strCon);
strCon2 = " AND Type = '03'";
strCon = strCon1 + strCon2;
IList listBYQ3 = Services.BaseService.GetList("SelectPSPDEVByCondition", strCon);
Hashtable ht = new Hashtable();
foreach (PSPDEV dev in listMX)
{
if (dev.Number <= 0)
{
wait.Close();
MessageBox.Show("母线" + dev.Name + "编号不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
else
{
if (ht.Contains(dev.Number))
{
wait.Close();
MessageBox.Show("母线" + dev.Name + "," + ((PSPDEV)ht[dev.Number]).Name + "编号重复", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
else
{
ht.Add(dev.Number, dev);
}
}
if (dev.KSwitchStatus=="投入运行"||dev.KSwitchStatus=="退出运行")
{
wait.Close();
MessageBox.Show("母线" + dev.Name + "运行方式重新点击一次", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
}
ht.Clear();
foreach (PSPDEV dev in listXL)
{
if (dev.Number <= 0)
{
//wait.Close();
//MessageBox.Show("线路" + dev.Name + "编号不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
//return false;
}
else
{
if (dev.FirstNode <= 0)
{
wait.Close();
MessageBox.Show("线路" + dev.Name + "没有i侧母线", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
if (dev.LastNode <= 0)
{
wait.Close();
MessageBox.Show("线路" + dev.Name + "没有j侧母线", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
if (ht.Contains(dev.Number))
{
wait.Close();
MessageBox.Show("线路" + dev.Name + "," + ((PSPDEV)ht[dev.Number]).Name + "编号重复", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
else
{
ht.Add(dev.Number, dev);
}
}
if (dev.KSwitchStatus == "投入运行" || dev.KSwitchStatus == "退出运行")
{
wait.Close();
MessageBox.Show("线路" + dev.Name + "运行方式重新点击一次", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
}
foreach (PSPDEV dev in listBYQ2)
{
if (dev.FirstNode <= 0)
{
wait.Close();
MessageBox.Show("两绕组变压器" + dev.Name + "没有i侧母线", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return false;
}
if (dev.LastNode <= 0)
{
//.........这里部分代码省略.........
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:101,代码来源:ElectricLoadCal.cs
示例8: barSave_ItemClick
private void barSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (treeList1.FocusedNode == null)
return;
string uid = treeList1.FocusedNode["UID"].ToString();
EconomyAnalysis obj = Services.BaseService.GetOneByKey<EconomyAnalysis>(uid);
System.IO.MemoryStream ms=new System.IO.MemoryStream();
WaitDialogForm wait = null;
try
{
wait = new WaitDialogForm("", "���ڱ�������, ���Ժ�...");
textBox1.Focus();
fpSpread1.Update();
fpSpread1.Save(ms, false);
obj.Contents = ms.GetBuffer();
Services.BaseService.Update("UpdateEconomyAnalysisByContents", obj);
excelstate = false;
wait.Close();
MsgBox.Show("����ɹ�");
}
catch (Exception ex) { wait.Close();
MsgBox.Show("����ʧ��");}
}
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:25,代码来源:FrmEconomyAnalysisSH.cs
示例9: IsSave
private void IsSave()
{
if (!editrights)
return;
if (MsgBox.ShowYesNo("�����Ѿ������ı䣬�Ƿ
|
请发表评论