Example #1
0
        private void Browse_Click(object sender, RoutedEventArgs e)
        {
            var close = false;

            using (var openDialog = new OpenFileDialog())
            {
                openDialog.InitializeLifetimeService();
                openDialog.Filter = "License files (*.xml)|*.xml|All files (*.*)|*.*";
                openDialog.Title  = "Select License file";

                if (ShowDialogInSTA(openDialog) == System.Windows.Forms.DialogResult.OK)
                {
                    string licenseFileSelected = openDialog.FileName;

                    if (ValidateLicenseFile(this, licenseFileSelected))
                    {
                        close = true;
                    }
                }
            }

            if (close)
            {
                this.DialogResult = true;
                this.Close();

                var registered = new Registered();
                registered.ShowDialog();
            }
        }
        private void Browse_Click(object sender, RoutedEventArgs e)
        {
            var close = false;

            using (var openDialog = new OpenFileDialog())
            {
                openDialog.InitializeLifetimeService();
                openDialog.Filter = "License files (*.xml)|*.xml|All files (*.*)|*.*";
                openDialog.Title = "Select License file";

                if (ShowDialogInSTA(openDialog) == System.Windows.Forms.DialogResult.OK)
                {
                    string licenseFileSelected = openDialog.FileName;

                    if (ValidateLicenseFile(this, licenseFileSelected))
                    {
                        close = true;
                    }
                }
            }

            if (close)
            {
                this.DialogResult = true;
                this.Close();

                var registered = new Registered();
                registered.ShowDialog();
            }
        }