Пример #1
0
        /// <summary>
        /// The txt_local proxy server address_ lost focus.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void TxtLocalProxyServerAddressLostFocus(object sender, RoutedEventArgs e)
        {
            IPAddress ip;

            if (this.TxtLocalProxyServerAddress.Text.Split('.').Length != 4 ||
                !IPAddress.TryParse(this.TxtLocalProxyServerAddress.Text, out ip))
            {
                this.TxtLocalProxyServerAddress.Text = "127.0.0.1";
                VDialog.Show(
                    "IP address is not acceptable.",
                    "Data Validation",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
                new Thread(
                    delegate()
                {
                    Thread.Sleep(10);
                    this.Dispatcher.Invoke(
                        (App.SimpleVoidDelegate)(() => this.TxtLocalProxyServerAddress.Focus()),
                        new object[] { });
                })
                {
                    IsBackground = true
                }.Start();
            }
            else
            {
                this.TxtLocalProxyServerAddress.Text = ip.ToString();
            }

            this.SaveSettings();
        }
Пример #2
0
        /// <summary>
        ///     The run app.
        /// </summary>
        private static void RunApp()
        {
            try
            {
                // Application Services
                ApplicationRestartRecoveryManager.RegisterForApplicationRestart(
                    new RestartSettings(string.Empty, RestartRestrictions.None));
            }
            catch (Exception)
            {
            }
            try
            {
                Notify = new NotifyIcon {
                    Visible = false
                };
                defualtApp.InitializeComponent();
                defualtApp.DispatcherUnhandledException += (s, e) =>
                {
                    VDialog.Show(
                        e.Exception.Message + "\r\n\r\n" + e.Exception.StackTrace,
                        "FATAL ERROR",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                    e.Handled = false;
                    End();
                };
                defualtApp.Run();
            }
            catch (Exception)
            {
            }

            End();
        }
Пример #3
0
        /// <summary>
        /// The txt_ connection_ send packet size_ lost focus.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void TxtConnectionSendPacketSizeLostFocus(object sender, RoutedEventArgs e)
        {
            uint u;

            if (!uint.TryParse(this.TxtConnectionSendPacketSize.Text, out u))
            {
                VDialog.Show(
                    "Value is not acceptable.",
                    "Data Validation",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
                this.TxtConnectionSendPacketSize.Text = 1024.ToString(CultureInfo.InvariantCulture);
                new Thread(
                    delegate()
                {
                    Thread.Sleep(10);
                    this.Dispatcher.Invoke(
                        (App.SimpleVoidDelegate)(() => this.TxtConnectionSendPacketSize.Focus()),
                        new object[] { });
                })
                {
                    IsBackground = true
                }.Start();
            }
            else
            {
                this.TxtConnectionSendPacketSize.Text = u.ToString(CultureInfo.InvariantCulture);
            }

            this.SaveSettings();
        }
Пример #4
0
 /// <summary>
 ///     The show dialog.
 /// </summary>
 /// <param name="message">
 ///     The message.
 /// </param>
 /// <param name="title">
 ///     The title.
 /// </param>
 /// <param name="messageBoxButtons">
 ///     The message box buttons.
 /// </param>
 /// <param name="messageBoxIcon">
 ///     The message box icon.
 /// </param>
 private void ShowDialog(
     string message,
     string title,
     MessageBoxButtons messageBoxButtons,
     MessageBoxIcon messageBoxIcon)
 {
     VDialog.Show(this, message, title, messageBoxButtons, messageBoxIcon);
 }
Пример #5
0
 public static void NewScene()
 {
     if (VDialog.DisplayDialog("是否需要建立新的Scene"))
     {
         EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo();
         EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects);
     }
 }
Пример #6
0
 private void FirstTimeWizardButton_OnClick(object sender, RoutedEventArgs e)
 {
     Settings.Default.Welcome_Shown = false;
     Settings.Default.Save();
     VDialog.Show(
         "Done. We will close this application and then you can reopen it and follow the wizard.",
         "First Time Wizard",
         MessageBoxButtons.OK,
         MessageBoxIcon.Information);
     App.End();
 }
Пример #7
0
 public static void ExportObj_Sub_mesh()
 {
     if (VDialog.DisplayDialog("你是否要将物件Mesh存为 OBJ 格式,并存为多个Sub-Mesh"))
     {
         if (Selection.gameObjects.Length == 0)
         {
             Debug.Log("Didn't Export Any Meshes; Nothing was Selected!"); return;
         }
         string meshName = Selection.gameObjects[0].name;
         makeSubmeshes = true;
         VFile.SaveFile(SaveOBJFile, "obj");
     }
 }
Пример #8
0
        /// <summary>
        /// The txt_server address_ lost focus.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void TxtServerAddressLostFocus(object sender, RoutedEventArgs e)
        {
            if (this.TxtServerAddress.Text == string.Empty)
            {
                return;
            }

            try
            {
                this.TxtServerAddress.Text = this.TxtServerAddress.Text.Replace("\\", "/");
                if (this.TxtServerAddress.Text.IndexOf("://", StringComparison.Ordinal) == -1)
                {
                    this.TxtServerAddress.Text = "http://" + this.TxtServerAddress.Text;
                }

                Uri uri = new Uri(this.TxtServerAddress.Text);
                if (
                    !(this.TxtServerAddress.Text.LastIndexOf(":", StringComparison.Ordinal) == -1 ||
                      this.TxtServerAddress.Text.LastIndexOf(":", StringComparison.Ordinal) == this.TxtServerAddress.Text.IndexOf(":", StringComparison.Ordinal)))
                {
                    this.TxtServerPort.Text = uri.Port.ToString(CultureInfo.InvariantCulture);
                }

                this.TxtServerAddress.Text = uri.Host;
                this.TxtServerPortTextChanged(sender, null);
            }
            catch (Exception ex)
            {
                VDialog.Show(
                    "Value is not acceptable.\r\n" + ex.Message,
                    "Data Validation",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
                this.TxtServerAddress.Text = string.Empty;
                new Thread(
                    delegate()
                {
                    Thread.Sleep(10);
                    this.Dispatcher.Invoke(
                        (App.SimpleVoidDelegate)(() => this.TxtServerAddress.Focus()),
                        new object[] { });
                })
                {
                    IsBackground = true
                }.Start();
            }

            this.SaveSettings();
        }
Пример #9
0
        /// <summary>
        /// The txt_server port_ text changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void TxtServerPortTextChanged(object sender, TextChangedEventArgs e)
        {
            ushort port;

            if (!ushort.TryParse(this.TxtServerPort.Text, out port))
            {
                VDialog.Show(
                    "Port Value is not acceptable.",
                    "Data Validation",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
                port = 1080;
            }

            this.TxtServerPort.Text = port.ToString(CultureInfo.InvariantCulture);
        }
Пример #10
0
        /// <summary>
        /// The txt_web_ lost focus.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        /// <exception cref="Exception">
        /// No https support
        /// </exception>
        private void TxtWebLostFocus(object sender, RoutedEventArgs e)
        {
            if (this.TxtWeb.Text == string.Empty)
            {
                return;
            }

            try
            {
                this.TxtWeb.Text = this.TxtWeb.Text.Replace("\\", "/");
                if (this.TxtWeb.Text.IndexOf("://", StringComparison.Ordinal) == -1)
                {
                    this.TxtWeb.Text = "http://" + this.TxtWeb.Text;
                }

                Uri uri = new Uri(this.TxtWeb.Text);
                if (uri.Scheme != Uri.UriSchemeHttp)
                {
                    throw new Exception("PeaRoxyWeb: Supporting only HTTP protocol.");
                }

                this.TxtWeb.Text = uri.ToString();
            }
            catch (Exception ex)
            {
                VDialog.Show(
                    "Value is not acceptable.\r\n" + ex.Message,
                    "Data Validation",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
                this.TxtWeb.Text = string.Empty;
                new Thread(
                    delegate()
                {
                    Thread.Sleep(10);
                    this.Dispatcher.Invoke(
                        (App.SimpleVoidDelegate)(() => this.TxtWeb.Focus()),
                        new object[] { });
                })
                {
                    IsBackground = true
                }.Start();
            }

            this.SaveSettings();
        }
Пример #11
0
        /// <summary>
        /// The txt_local proxy server port_ text changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void TxtLocalProxyServerPortTextChanged(object sender, TextChangedEventArgs e)
        {
            ushort port;

            if (!ushort.TryParse(this.TxtLocalProxyServerPort.Text, out port))
            {
                VDialog.Show(
                    "Port Value is not acceptable.",
                    "Data Validation",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
                port = 1080;
            }

            this.LblAutoConfigScriptPreAddressRefresh(null, null);
            this.TxtLocalProxyServerPort.Text = port.ToString(CultureInfo.InvariantCulture);
            this.SaveSettings();
        }
Пример #12
0
        /// <summary>
        /// The btn_resetsettings_ click.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void BtnResetsettingsClick(object sender, RoutedEventArgs e)
        {
            if (
                VDialog.Show(
                    "This operation will reset all settings to default and close this application, are you sure?!",
                    "Reset Settings",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question) != DialogResult.Yes)
            {
                return;
            }

            Settings.Default.Reset();
            Settings.Default.FirstRun = false;
            Settings.Default.Save();
            VDialog.Show(
                "Done. We will close this application and then you can reopen it with default settings.",
                "Reset Settings",
                MessageBoxButtons.OK,
                MessageBoxIcon.Information);
            App.End();
        }
Пример #13
0
        /// <summary>
        ///     The txt_server_ leave.
        /// </summary>
        /// <param name="sender">
        ///     The sender.
        /// </param>
        /// <param name="e">
        ///     The e.
        /// </param>
        private void TxtServerLeave(object sender, EventArgs e)
        {
            if (this.txt_server.Text == string.Empty)
            {
                return;
            }

            try
            {
                this.txt_server.Text = this.txt_server.Text.Replace("\\", "/");
                if (this.txt_server.Text.IndexOf("://", StringComparison.Ordinal) == -1)
                {
                    this.txt_server.Text = @"http://" + this.txt_server.Text;
                }

                Uri uri = new Uri(this.txt_server.Text);
                this.txt_server.Text = uri.IsDefaultPort ? uri.Host : uri.Host + ":" + uri.Port;
            }
            catch (Exception ex)
            {
                VDialog.Show(
                    "Value is not acceptable.\r\n" + ex.Message,
                    "Data Validation",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
                this.txt_server.Text = string.Empty;
                new Thread(
                    delegate()
                {
                    Thread.Sleep(10);
                    this.Invoke((SimpleVoidDelegate)(() => this.txt_server.Focus()), new object[] { });
                })
                {
                    IsBackground = true
                }.Start();
            }

            this.SaveSettings();
        }
Пример #14
0
        /// <summary>
        ///     The hook_ save item.
        /// </summary>
        public void HookSaveItem()
        {
            try
            {
                string app = this.TxtHookEditApp.Text.ToLower().Trim();
                if (app != string.Empty && !this.LbHookProcesses.Items.Contains(app))
                {
                    this.LbHookProcesses.Items.Add(app);
                }

                this.SaveSettings();
                this.HideOptionsDialog();
            }
            catch (Exception e)
            {
                VDialog.Show(
                    "Can't add process name: " + e.Message,
                    "PeaRoxy Client - Hook Processes Update",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Stop);
            }
        }
Пример #15
0
        public void ReConfig(bool silent, bool?forceState = null)
        {
            bool isListenerActive = this.listener != null &&
                                    this.listener.Status.HasFlag(ProxyController.ControllerStatus.Proxy);

            if (!forceState.HasValue || !forceState.Value)
            {
                if (!isListenerActive)
                {
                    ProxyModule.DisableProxy();
                    ProxyModule.DisableProxyAutoConfig();
                }

                if (isListenerActive && TapTunnelModule.IsRunning())
                {
                    TapTunnelModule.StopTunnel();
                }
                TapTunnelModule.CleanAllTunnelProcesses();

                if (isListenerActive && HookModule.IsHookProcessRunning())
                {
                    HookModule.StopHookProcess();
                }
                HookModule.CleanAllHookProcesses();
            }

            if ((forceState.HasValue && !forceState.Value) || !isListenerActive)
            {
                return;
            }

            switch ((GrabberType)Settings.Default.Grabber)
            {
            case GrabberType.Proxy:
                bool res        = ProxyModule.SetActiveProxy(new IPEndPoint(IPAddress.Loopback, this.listener.Port));
                bool firefoxRes = ProxyModule.ForceFirefoxToUseSystemSettings();

                if (!res)
                {
                    if (silent)
                    {
                        Program.Notify.ShowBalloonTip(
                            5000,
                            "Proxy Grabber",
                            "We failed to register PeaRoxy as active proxy for this system. You may need to do it manually or restart/re-logon your PC and let us try again.",
                            ToolTipIcon.Warning);
                    }
                    else
                    {
                        if (VDialog.Show(
                                this,
                                "We failed to register PeaRoxy as active proxy for this system. You may need to do it manually or restart/re-logon your PC and let us try again.\r\nDo want us to logoff your user account?! Please save your work in other applications before making a decision.",
                                "Proxy Grabber",
                                MessageBoxButtons.YesNo,
                                MessageBoxIcon.Warning) == DialogResult.Yes)
                        {
                            WinCommon.LogOffUser();
                        }
                    }
                }
                else
                {
                    if (firefoxRes)
                    {
                        Program.Notify.ShowBalloonTip(
                            5000,
                            "Proxy Grabber",
                            "PeaRoxy successfully registered as active proxy of this system. You may need to restart your browser to be able to use it along with PeaRoxy.",
                            ToolTipIcon.Info);
                    }
                    else
                    {
                        Program.Notify.ShowBalloonTip(
                            5000,
                            "Proxy Grabber",
                            "PeaRoxy successfully registered as active proxy of this system. Firefox probably need some manual configurations, also you may need to restart your browser to be able to use it along with PeaRoxy.",
                            ToolTipIcon.Warning);
                    }
                }

                break;

            case GrabberType.Tap:
                if (this.listener != null && this.listener.Status.HasFlag(ProxyController.ControllerStatus.Proxy))
                {
                    TapTunnelModule.AdapterAddressRange     = IPAddress.Parse(Settings.Default.TAP_IPRange);
                    TapTunnelModule.DnsResolvingAddress     = IPAddress.Loopback;
                    TapTunnelModule.SocksProxyEndPoint      = new IPEndPoint(IPAddress.Loopback, this.listener.Port);
                    TapTunnelModule.AutoDnsResolving        = true;
                    TapTunnelModule.AutoDnsResolvingAddress = IPAddress.Parse(Settings.Default.DNS_IPAddress);
                    TapTunnelModule.TunnelName = "ZARA Tunnel";

                    if (TapTunnelModule.StartTunnel())
                    {
                        Program.Notify.ShowBalloonTip(
                            5000,
                            "TAP Grabber",
                            "TAP Adapter activated successfully. You are ready to go.",
                            ToolTipIcon.Info);
                    }
                    else
                    {
                        TapTunnelModule.StopTunnel();
                        if (silent)
                        {
                            Program.Notify.ShowBalloonTip(
                                5000,
                                "TAP Grabber",
                                "Failed to start TAP Adapter. Tap grabber disabled. Please go to control panel to see if network adapter is disable.",
                                ToolTipIcon.Warning);
                        }
                        else
                        {
                            VDialog.Show(
                                this,
                                "Failed to start TAP Adapter. Tap grabber disabled. Please go to control panel to see if network adapter is disable.",
                                "TAP Grabber",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                        }
                    }
                }
                break;

            case GrabberType.Hook:
                HookModule.StartHookProcess(
                    Settings.Default.Hook_Processes.Split(
                        new[] { Environment.NewLine },
                        StringSplitOptions.RemoveEmptyEntries),
                    new IPEndPoint(IPAddress.Loopback, this.listener.Port),
                    string.Empty);

                Program.Notify.ShowBalloonTip(
                    5000,
                    "Hook Grabber",
                    "Hook process started successfully and actively monitor running applications from now on. You are ready to go.",
                    ToolTipIcon.Info);
                break;
            }
        }
Пример #16
0
        /// <summary>
        /// The smart_ save or add item.
        /// </summary>
        /// <exception cref="Exception">
        /// Empty rule detected
        /// </exception>
        public void SmartSaveOrAddItem()
        {
            try
            {
                string rule = this.TxtSmartEditRule.Text.ToLower();
                if (rule.IndexOf("://", StringComparison.Ordinal) != -1)
                {
                    rule = rule.Substring(rule.IndexOf("://", StringComparison.Ordinal) + 3);
                }

                if (rule.IndexOf("|", StringComparison.Ordinal) != -1)
                {
                    rule = rule.Substring(rule.IndexOf("|", StringComparison.Ordinal) + 1).Trim();
                }

                rule = rule.Replace("\\", "/").Replace("//", "/").Replace("//", "/").Replace("//", "/");
                if (rule == string.Empty)
                {
                    throw new Exception("Rule can not be empty.");
                }

                bool https = false;
                switch (((ComboBoxItem)this.CbSmartEditType.SelectedItem).Tag.ToString().ToLower())
                {
                case "direct":
                    https = true;
                    if (rule.IndexOf("/", StringComparison.Ordinal) != -1)
                    {
                        throw new Exception("Direct rules cannot contain slash.");
                    }

                    if (rule.IndexOf(":", StringComparison.Ordinal) == -1)
                    {
                        throw new Exception("Direct rules must have port number.");
                    }

                    break;

                case "http":

                    break;

                default:
                    return;
                }

                int cp = -1;
                if (this.TxtSmartEditRule.Tag != null)
                {
                    cp = this.SmartList.Items.IndexOf(this.TxtSmartEditRule.Tag);
                    this.SmartList.Items.RemoveAt(cp);
                }

                if (cp == -1)
                {
                    cp = this.SmartList.Items.Count;
                }

                if (https)
                {
                    this.SmartList.Items.Insert(cp, "(Direct) " + rule);
                }
                else
                {
                    this.SmartList.Items.Insert(cp, "(Http) " + rule);
                }

                this.SaveSettings();
                this.HideOptionsDialog();
            }
            catch (Exception e)
            {
                VDialog.Show(
                    "Can't add or edit rule: " + e.Message,
                    "PeaRoxy Client - Smart List Update",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Stop);
            }
        }
Пример #17
0
        /// <summary>
        ///     The main form load
        /// </summary>
        /// <param name="sender">
        ///     The sender.
        /// </param>
        /// <param name="e">
        ///     The e.
        /// </param>
        private void FrmMainLoad(object sender, EventArgs e)
        {
            if (Settings.Default.FirstRun)
            {
                if (Settings.Default.UpdateSettings)
                {
                    Settings.Default.Upgrade();
                }

                Settings.Default.FirstRun = false;
                Settings.Default.Save();
            }

            WindowsModule platform = new WindowsModule();

            platform.RegisterPlatform();
            this.ReloadSettings();

            this.updaterWorker         = new BackgroundWorker();
            this.skipUpdate            = !Settings.Default.AutoUpdate;
            this.updaterWorker.DoWork += (s, args) =>
            {
                this.latestVersion = null;
                try
                {
                    if (!this.skipUpdate)
                    {
                        Updater updaterObject = new Updater(
                            "ZARA",
                            Assembly.GetExecutingAssembly().GetName().Version,
                            this.listener != null &&
                            this.listener.Status.HasFlag(ProxyController.ControllerStatus.Proxy)
                                    ? new WebProxy(this.listener.Ip + ":" + this.listener.Port, true)
                                    : null);
                        if (updaterObject.IsNewVersionAvailable())
                        {
                            this.latestVersion = updaterObject.GetLatestVersion();
                        }
                    }
                }
                catch (Exception)
                {
                }
            };
            this.updaterWorker.RunWorkerCompleted += (s, args) =>
            {
                try
                {
                    if (this.latestVersion != null)
                    {
                        VDialog updaterDialog = new VDialog
                        {
                            Content =
                                "New version of this application is available for download, do you want us to open the release page so you can download it?",
                            WindowTitle = "Auto Update Check",
                            MainIcon    = VDialogIcon.Question,
                            Buttons     =
                                new[]
                            {
                                new VDialogButton(VDialogResult.No, "No"),
                                new VDialogButton(
                                    VDialogResult.Yes,
                                    "Yes",
                                    true)
                            }
                        };

                        this.skipUpdate = updaterDialog.Show() != VDialogResult.Yes;
                        if (!this.skipUpdate)
                        {
                            Process.Start(this.latestVersion.PageLink);
                        }
                    }
                }
                catch
                {
                }
            };

            this.updaterWorker.RunWorkerAsync();

            try
            {
                Program.Notify.ContextMenu =
                    new ContextMenu(
                        new[]
                {
                    new MenuItem(
                        "Show Window",
                        delegate
                    {
                        Program.Notify.GetType()
                        .GetMethod(
                            "OnDoubleClick",
                            BindingFlags.Instance | BindingFlags.NonPublic)
                        .Invoke(Program.Notify, new object[] { null });
                    })
                    {
                        DefaultItem = true
                    },
                    new MenuItem("-", (EventHandler)null), new MenuItem(
                        "Exit",
                        delegate
                    {
                        this.StopServer();
                        Application.Exit();
                    })
                });
                Program.Notify.Icon         = Resources.Icon;
                Program.Notify.Text         = @"Z A Я A - Stopped";
                Program.Notify.DoubleClick += this.BtnMinimizeClick;
            }
            catch (Exception)
            {
            }
        }
Пример #18
0
 private void Download()
 {
     this.downloader = new WebClient {
         Proxy = this.Proxy ?? new WebProxy()
     };
     this.downloader.DownloadProgressChanged +=
         (DownloadProgressChangedEventHandler) delegate(object s, DownloadProgressChangedEventArgs ea)
     {
         // ReSharper disable once RedundantCheckBeforeAssignment
         if (this.progressBar.Style != ProgressBarStyle.Continuous)
         {
             this.progressBar.Style = ProgressBarStyle.Continuous;
         }
         this.progressBar.Value = ea.ProgressPercentage;
     };
     this.downloader.DownloadFileCompleted +=
         (AsyncCompletedEventHandler) delegate(object s, AsyncCompletedEventArgs ea)
     {
         if (!this.Visible)
         {
             return;
         }
         this.progressBar.Style = ProgressBarStyle.Marquee;
         this.progressBar.Value = 0;
         if (ea.Cancelled || ea.Error != null)
         {
             if (VDialog.Show(
                     this,
                     @"Failed to download update file.",
                     @"Download Error",
                     MessageBoxButtons.RetryCancel,
                     MessageBoxIcon.Exclamation) == DialogResult.Retry)
             {
                 this.Download();
             }
             else
             {
                 this.DialogResult = DialogResult.Abort;
                 this.Close();
             }
         }
         else if (this.ExecuteAtEnd)
         {
             try
             {
                 if (File.Exists(this.Filename))
                 {
                     Process.Start(this.Filename);
                     Environment.Exit(0);
                 }
             }
             catch (Exception)
             {
                 VDialog.Show(
                     this,
                     @"Failed to execute update file.",
                     @"Update Error",
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
             }
             this.DialogResult = DialogResult.Abort;
             this.Close();
         }
         else
         {
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
     };
     this.downloader.DownloadFileAsync(new Uri(this.DownloadUrl), this.Filename, this.downloader);
 }