Ejemplo n.º 1
0
 /// <summary>
 /// 写电阻/电容/电抗的表格数据到excel
 /// </summary>
 /// <param name="rlc">电阻/电容/电抗</param>
 /// <param name="startRow">开始行</param>
 /// <param name="startColumn">开始列</param>
 /// <returns>操作的行数</returns>
 private int WriteDataTable(RLC.BaseRLC rlc, int startRow, int startColumn)
 {
     string[,] rlcData = (string[, ])ReadDataTable(rlc.dt);
     excel.MergeCells(startRow, startColumn, startRow, startColumn + rlcData.GetLength(1) - 1, rlc.projectName);
     excel.ArrayToExcel(rlcData, startRow + 1, startColumn);
     excel.MergeCells(startRow + rlcData.GetLength(0) + 1, startColumn, startRow + rlcData.GetLength(0) + 1, startColumn + rlcData.GetLength(1) - 1, "");
     excel.ArrayToExcel(rlc.GetTotalStringArr(), startRow + rlcData.GetLength(0) + 2, startColumn);
     excel.setBorders(startRow, startColumn, startRow + rlcData.GetLength(0) + 2, startColumn + rlcData.GetLength(1) - 1);
     return(rlcData.GetLength(0) + 2);
 }
Ejemplo n.º 2
0
 private readonly object _mylock = new object();//防止多创建win_ng窗体
 /// <summary>
 /// 显示win_ng
 /// </summary>
 private void win_ngShow(RLC.BaseRLC baseRLC)
 {
     lock (_mylock)
     {
         if (win_ng == null || win_ng.IsDisposed)
         {
             win_ng = new numerical_gpbwindows(baseRLC);
         }
         else
         {
             win_ng.BaseRLC = baseRLC;
         }
     }
     if (!childForm.Controls.Contains(win_ng))
     {
         win_ng.Show();
         childForm.Controls.Clear();
         childForm.Controls.Add(win_ng);
     }
 }
 public numerical_gpbwindows(RLC.BaseRLC baseRLC)
 {
     InitializeComponent();
     this.BaseRLC = baseRLC;
     initForm();
 }