예제 #1
0
        void OkButtonClick(object sender, EventArgs e)
        {
            KeyFile = KeyFile.Trim();
            if (KeyFile.Length == 0)
            {
                MessageService.ShowMessage("${res:Dialog.ProjectOptions.Signing.EnterKeyName}");
                return;
            }
            bool usePassword = Get <CheckBox>("usePassword").Checked;

            if (usePassword)
            {
                if (!CheckPassword(ControlDictionary["passwordTextBox"],
                                   ControlDictionary["confirmPasswordTextBox"]))
                {
                    return;
                }
                MessageService.ShowMessage("Creating a key file with a password is currently not supported.");
                return;
            }
            if (!KeyFile.EndsWith(".snk") && !KeyFile.EndsWith(".pfx"))
            {
                KeyFile += ".snk";
            }
            if (CreateKey(Path.Combine(baseDirectory, KeyFile)))
            {
                this.DialogResult = DialogResult.OK;
                Close();
            }
        }