Browse Source

edit code format

gsp 2 years ago
parent
commit
5e0c55b43b
1 changed files with 23 additions and 17 deletions
  1. 23 17
      OTSIncAReportApp/2-CommonFunction/CommonClass/DisplayParticle.cs

+ 23 - 17
OTSIncAReportApp/2-CommonFunction/CommonClass/DisplayParticle.cs

@@ -572,32 +572,38 @@ namespace OTSIncAReportGraph
            
             if (GetPaintState() == PaintState.PAINT)
             {
-                DisplaySegment ds = m_listdsegment[0];
-                if (ds.ShowMode == SegmentShowMode.DRAWPOINT)
+                if (m_listdsegment.Count > 0)
                 {
-                    try
+
+                    DisplaySegment ds = m_listdsegment[0];
+                    if (ds.ShowMode == SegmentShowMode.DRAWPOINT)
                     {
-                        e.Graphics.DrawImage(m_image, m_rect);
+                        try
+                        {
+                            e.Graphics.DrawImage(m_image, m_rect);
+
+                        }
+                        catch (Exception ex)
+                        {
+                            NLog.LogManager.GetCurrentClassLogger().Error(ex.ToString());
+                        }
+
 
                     }
-                    catch (Exception ex)
+                    else
                     {
-                        NLog.LogManager.GetCurrentClassLogger().Error(ex.ToString());
-                    }
-                  
+                        //调用绘制基本线
+                        foreach (DisplaySegment item in m_listdsegment)
+                        {
+                            item.OnPaint(e);
+                        }
 
-                }
-                else 
-                {
-                    //调用绘制基本线
-                    foreach (DisplaySegment item in m_listdsegment)
-                    {
-                        item.OnPaint(e);
                     }
 
                 }
-             
-              
+
+
+