コード例 #1
0
        private void CalcMax()
        {
            try {
                double LSpacing = ss.Dbl_CalcOptLSpace;
                double WSpacing = ss.Dbl_CalcOptWSpace;

                ss.Str_MaxFrmWallL = (LSpacing / 2).ToString("0.00");
                ss.Str_MaxFrmWallW = (WSpacing / 2).ToString("0.00");

                int QtyL = Convert.ToInt32(Math.Ceiling(Math.Round(ss.Dbl_RoomLength / LSpacing, 2)));
                int QtyW = Convert.ToInt32(Math.Ceiling(Math.Round(ss.Dbl_RoomWidth / WSpacing, 2)));

                ss.Str_BranchQtyL   = QtyL.ToString();
                ss.Str_BranchQtyW   = QtyW.ToString();
                ss.Str_SprinklerQty = (QtyL * QtyW).ToString();

                double LSP = (ss.Dbl_RoomLength - LSpacing) / (QtyL - 1);
                double WSP = (ss.Dbl_RoomWidth - WSpacing) / (QtyW - 1);

                ss.Str_BtwSprnkDimL = LSP.ToString("0.00");
                ss.Str_BtwSprnkDimW = WSP.ToString("0.00");

                AnyDesignErrors();
            } catch (Exception) {
                AppBody.Background = ColorExt.ToBrush(System.Drawing.Color.LightPink);
            }
        }
コード例 #2
0
 private void TextBoxRoomLen_TextChanged(object sender, TextChangedEventArgs e)
 {
     try {
         AnyDesignErrors();
         RunAllCalcs();
     } catch (InvalidCastException) {
         AppBody.Background = ColorExt.ToBrush(System.Drawing.Color.LightPink);
     }
 }
コード例 #3
0
 private bool AnyDesignErrors()
 {
     if (DesignErrorOpArea)
     {
         AppBody.Background = ColorExt.ToBrush(System.Drawing.Color.LightPink);
         return(true);
     }
     if (DesignErrorSpacing)
     {
         AppBody.Background = ColorExt.ToBrush(System.Drawing.Color.LightPink);
         return(true);
     }
     AppBody.Background = ColorExt.ToBrush(System.Drawing.Color.AliceBlue);
     return(false);
 }