private DialogResult ChooseEdition(bool exitOnCancel)
        {
            Forms.EditionChooserForm ecf = new CallButler.Manager.Forms.EditionChooserForm();

            ecf.SetEditions(ManagementInterfaceClient.ManagementInterface.AvailableEditions);

            this.BringToFront();
            ecf.TopMost = true;

            if (ecf.ShowDialog(this) == DialogResult.OK)
            {
                global::Controls.LoadingDialog.ShowDialog(null, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_ChangingEdition), Properties.Resources.loading, false, 0);

                // Set our new product ID
                ManagementInterfaceClient.ManagementInterface.SetProductID(ManagementInterfaceClient.AuthInfo, ecf.GetSelectedEditionProductID());
                ManagementInterfaceClient.ManagementInterface.RestartService(ManagementInterfaceClient.AuthInfo);
                System.Threading.Thread.Sleep(2000);

                global::Controls.LoadingDialog.HideDialog();

                return(DialogResult.OK);
            }
            else if (exitOnCancel && (ManagementInterfaceClient.ManagementInterface.ProductID == null || ManagementInterfaceClient.ManagementInterface.ProductID.Length == 0))
            {
                Environment.Exit(1);
            }

            return(DialogResult.Cancel);
        }
Пример #2
0
        private DialogResult ChooseEdition(bool exitOnCancel)
        {
            Forms.EditionChooserForm ecf = new CallButler.Manager.Forms.EditionChooserForm();

            ecf.SetEditions(ManagementInterfaceClient.ManagementInterface.AvailableEditions);

            this.BringToFront();
            ecf.TopMost = true;

            if(ecf.ShowDialog(this) == DialogResult.OK)
            {
                global::Controls.LoadingDialog.ShowDialog(null, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Common_ChangingEdition), Properties.Resources.loading, false, 0);

                // Set our new product ID
                ManagementInterfaceClient.ManagementInterface.SetProductID(ManagementInterfaceClient.AuthInfo, ecf.GetSelectedEditionProductID());
                ManagementInterfaceClient.ManagementInterface.RestartService(ManagementInterfaceClient.AuthInfo);
                System.Threading.Thread.Sleep(2000);

                global::Controls.LoadingDialog.HideDialog();

                return DialogResult.OK;
            }
            else if (exitOnCancel && (ManagementInterfaceClient.ManagementInterface.ProductID == null || ManagementInterfaceClient.ManagementInterface.ProductID.Length == 0))
            {
                Environment.Exit(1);
            }

            return DialogResult.Cancel;
        }