コード例 #1
0
        public string CollectPasswordForUser(Guid deploymentId, string environmentName, string machineName, string userName)
        {
            Guard.NotEmpty(deploymentId, "deploymentId");
            Guard.NotNullNorEmpty(environmentName, "environmentName");
            Guard.NotNullNorEmpty(machineName, "machineName");
            Guard.NotNullNorEmpty(userName, "userName");

            var passwordPromptForm =
                new PasswordPromptForm
            {
                EnvironmentName = environmentName,
                MachineName     = machineName,
                UserName        = userName,
            };

            DialogResult dialogResult =
                passwordPromptForm
                .ShowDialog();

            if (dialogResult == DialogResult.Cancel)
            {
                return(null);
            }

            return(passwordPromptForm.EnteredPassword);
        }
コード例 #2
0
        public string CollectPasswordForUser(Guid deploymentId, string environmentName, string machineName, string userName)
        {
            Guard.NotEmpty(deploymentId, "deploymentId");
              Guard.NotNullNorEmpty(environmentName, "environmentName");
              Guard.NotNullNorEmpty(machineName, "machineName");
              Guard.NotNullNorEmpty(userName, "userName");

              var passwordPromptForm =
            new PasswordPromptForm
              {
            EnvironmentName = environmentName,
            MachineName = machineName,
            UserName = userName,
              };

              DialogResult dialogResult =
            passwordPromptForm
              .ShowDialog();

              if (dialogResult == DialogResult.Cancel)
              {
            return null;
              }

              return passwordPromptForm.EnteredPassword;
        }
コード例 #3
0
        public string CollectPasswordForUser(string environmentName, string machineName, string userName)
        {
            if (string.IsNullOrEmpty(environmentName))
              {
            throw new ArgumentException("Argument can't be null nor empty.", "environmentName");
              }

              if (string.IsNullOrEmpty(machineName))
              {
            throw new ArgumentException("Argument can't be null nor empty.", "machineName");
              }

              if (string.IsNullOrEmpty(userName))
              {
            throw new ArgumentException("Argument can't be null nor empty.", "userName");
              }

              var passwordPromptForm =
            new PasswordPromptForm
              {
            EnvironmentName = environmentName,
            MachineName = machineName,
            UserName = userName,
              };

              DialogResult dialogResult =
            passwordPromptForm
              .ShowDialog();

              if (dialogResult == DialogResult.Cancel)
              {
            return null;
              }

              return passwordPromptForm.EnteredPassword;
        }