Ejemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();
            Version ver = System.Reflection.Assembly.GetEntryAssembly().GetName().Version;
            this.Text = this.Text + " - Version " + ver.Major + "." + ver.Minor;
            webBrowser1.Url = new Uri("http://jessenic.github.com/EasyWP7Updater/news.html#" + ver.ToString());
            checkForZune();
            try
            {
                if (!closeOnStart)
                {
                    deviceService = new DeviceService();
                    deviceService.OnServiceMessageSent += new DeviceService.ServiceMessageEventhandler(handleUpdateMessage);
                    deviceService.OnDevicesChanged += new DeviceService.DevicesChangedEventhandler(updateHelper_OnDevicesChanged);
                    deviceService.OnUpdateFinished += new EventHandler(updateFinished);
                    refreshDevices();
                }
            }
            catch (System.Runtime.InteropServices.COMException)
            {
                bool is64bit = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"));

                if (is64bit)
                {
                    if (MessageBox.Show("This application requires the x64 version of the WP Support Tool. Do you want to open the downloadpage?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        Process.Start(@"http://download.microsoft.com/download/6/6/6/666ED30F-15E4-4287-8E73-CE08CCE07AAB/WPSupportToolv2-amd64.msi");
                    }
                }
                else
                {
                    if (MessageBox.Show("This application requires the x86 version of the WP Support Tool. Do you want to open the downloadpage?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        Process.Start(@"http://download.microsoft.com/download/6/6/6/666ED30F-15E4-4287-8E73-CE08CCE07AAB/WPSupportToolv2-x86.msi");
                    }
                }

                closeOnStart = true;
            }

            foreach (KeyValuePair<string, string> s in Helper.LanguageList.Languages)
                selectInstalledLanguagesBox.Items.Add(s.Key);

            for (int i = 0; i < selectInstalledLanguagesBox.Items.Count; i++)
                selectInstalledLanguagesBox.SetItemChecked(i, true);
        }
Ejemplo n.º 2
0
        private void closeMainForm()
        {
            if (deviceService != null)
                deviceService.Dispose();

            DeviceManagerSingleton.Cleanup();
            deviceService = null;
            this.Dispose();
        }