예제 #1
0
        private static void SplashImageAssync(ComplexDlgOptions Options)
        {
            SplashDialog thisSplash = null;

            System.Drawing.Image thisImage = null;

            if (splashDialogs.ContainsKey(Options.GUIID))
            {
                thisSplash = splashDialogs[Options.GUIID];
                if (thisSplash.InvokeRequired)
                {
                    thisSplash.Invoke(new AsyncCallDlgOptions(SplashImageAssync), Options);
                }
            }

            if (thisSplash != null)
            {
                Options.AppendShowHideTo(thisSplash);
            }
            else
            {
                thisSplash = new SplashDialog();
                splashDialogs.Add(Options.GUIID, thisSplash);
            }

            Options.AppendTo(thisSplash);

            #region Splash specific Options

            if (File.Exists(Options.Param1))
            {
                try
                {
                    thisImage = System.Drawing.Bitmap.FromFile(Options.Param1);
                }
                catch (Exception)
                {
                    ErrorLevel = 1;
                    return;
                }

                if (thisImage != null)
                {
                    thisSplash.Image = thisImage;
                }
            }

            #endregion Splash specific Options

            if (!Options.Hide && !thisSplash.Visible)
            {
                thisSplash.Show();
            }
        }
예제 #2
0
파일: Dialogs.cs 프로젝트: lnsoso/IronAHK
        private static void SplashImageAssync(ComplexDlgOptions Options) {

            SplashDialog thisSplash = null;
            System.Drawing.Image thisImage = null;


            if(splashDialogs.ContainsKey(Options.GUIID)) {
                thisSplash = splashDialogs[Options.GUIID];
                if(thisSplash.InvokeRequired) {
                    thisSplash.Invoke(new AsyncCallDlgOptions(SplashImageAssync), Options);
                }
            }

            if(thisSplash != null) {
                Options.AppendShowHideTo(thisSplash);
            } else {
                thisSplash = new SplashDialog();
                splashDialogs.Add(Options.GUIID, thisSplash);
            }

            Options.AppendTo(thisSplash);

            #region Splash specific Options

            if(File.Exists(Options.Param1)) {
                try {
                    thisImage = System.Drawing.Bitmap.FromFile(Options.Param1);
                } catch(Exception) {
                    ErrorLevel = 1;
                    return;
                }

                if(thisImage != null) {
                    thisSplash.Image = thisImage;
                }
            }

            #endregion

            if(!Options.Hide && !thisSplash.Visible)
                thisSplash.Show();

        }