@@ -48,8 +48,8 @@ private void InitSkin()
4848
4949 private void MainForm_Load ( object sender , EventArgs e )
5050 {
51- // 设置窗体透明
52- SetOpacity ( 0 ) ;
51+ // 程序启动画面
52+ SetIsStarting ( true ) ;
5353 }
5454
5555 private void InitBrowser ( )
@@ -67,14 +67,14 @@ private void InitBrowser()
6767 crBrowser . GetBrowser ( ) . FrameLoadEnd += new EventHandler < FrameLoadEndEventArgs > ( Browser_FrameLoadEnd ) ; // 浏览器初始化完毕时执行
6868
6969 crDownloads = new CrDownloads ( crBrowser ) ;
70-
70+
7171 ContentPanel . Controls . Add ( crBrowser . GetBrowser ( ) ) ;
7272 }
73-
73+
7474 private void Browser_FrameLoadEnd ( object sender , FrameLoadEndEventArgs e )
7575 {
76- // 取消设置窗体透明
77- SetOpacity ( 1 ) ;
76+ // 关闭程序启动画面
77+ SetIsStarting ( false ) ;
7878 }
7979
8080 /// <summary>
@@ -85,9 +85,15 @@ public class AppActionForJs
8585 // 获取程序版本
8686 public string getVersion ( )
8787 {
88+ crBrowser . RunJS ( $ "AppConfig.updateCheckUrl=\" { GlobalConstant . UpdateCheckUrl } \" ;AppConfig.updateCheckToken=\" { GlobalConstant . UpdateCheckToken } \" ") ;
8889 return System . Reflection . Assembly . GetExecutingAssembly ( ) . GetName ( ) . Version . ToString ( ) ;
8990 }
9091
92+ public void showDevTools ( )
93+ {
94+ crBrowser . GetBrowser ( ) . ShowDevTools ( ) ;
95+ }
96+
9197 // 采集是否使用IE代理请求
9298 public void _utilsReqIeProxy ( bool isEnable )
9399 {
@@ -210,16 +216,40 @@ public void StartTask(object obj)
210216 Utils . ReleaseMemory ( true ) ;
211217 }
212218
219+
220+ private Form startingForm ;
221+
213222 /// <summary>
214- /// 设置窗体透明度
223+ /// 设置程序启动画面
215224 /// </summary>
216- public void SetOpacity ( int value )
225+ public void SetIsStarting ( bool isStarting )
217226 {
218- if ( this . InvokeRequired ) { this . Invoke ( new SetOpacityDelegate ( SetOpacity ) , new object [ ] { value } ) ; return ; }
227+ if ( this . InvokeRequired ) { this . Invoke ( new SetIsStartingDelegate ( SetIsStarting ) , new object [ ] { isStarting } ) ; return ; }
219228
220- this . Opacity = value ;
229+ if ( isStarting )
230+ {
231+ startingForm = new Form
232+ {
233+ Size = new Size ( 640 , 400 ) ,
234+ TopMost = true ,
235+ ControlBox = false ,
236+ ShowInTaskbar = false ,
237+ AutoSizeMode = AutoSizeMode . GrowAndShrink ,
238+ FormBorderStyle = FormBorderStyle . None ,
239+ StartPosition = FormStartPosition . CenterScreen ,
240+ BackgroundImageLayout = ImageLayout . Zoom ,
241+ BackgroundImage = Properties . Resources . StartingImg
242+ } ;
243+ startingForm . Show ( ) ;
244+ this . Opacity = 0 ;
245+ } else
246+ {
247+ startingForm . Hide ( ) ;
248+ this . Opacity = 1 ;
249+ }
250+
221251 }
222- public delegate void SetOpacityDelegate ( int value ) ;
252+ public delegate void SetIsStartingDelegate ( bool isStarting ) ;
223253
224254 private void MainForm_FormClosing ( object sender , FormClosingEventArgs e )
225255 {
0 commit comments