Esempio n. 1
0
 public static void SetProperty(PswsCmdlet cmdlet, string propertyName, SmtpAddress propertyValue)
 {
     if (propertyValue.Length > 0)
     {
         cmdlet.Parameters[propertyName] = propertyValue.ToString();
     }
 }
Esempio n. 2
0
 public static void SetProperty(PswsCmdlet cmdlet, string propertyName, OrganizationIdParameter propertyValue)
 {
     if (propertyValue != null)
     {
         cmdlet.Parameters[propertyName] = propertyValue.ToString();
     }
 }
Esempio n. 3
0
 public static void SetProperty(PswsCmdlet cmdlet, string propertyName, WindowsLiveId propertyValue)
 {
     if (propertyValue != null)
     {
         cmdlet.Parameters[propertyName] = propertyValue.ToString();
     }
 }
Esempio n. 4
0
 public static void CheckForError(Task task, PswsCmdlet cmdlet)
 {
     ArgumentValidator.ThrowIfNull("task", task);
     ArgumentValidator.ThrowIfNull("cmdlet", cmdlet);
     if (!string.IsNullOrEmpty(cmdlet.Error))
     {
         string errMsg = cmdlet.Error.ToString();
         EOPRecipient.PublishErrorEvent(errMsg);
         string        text          = "<NULL>";
         Authenticator authenticator = cmdlet.Authenticator as Authenticator;
         if (authenticator != null)
         {
             text = text.ToString();
         }
         ExManagementApplicationLogger.LogEvent(ManagementEventLogConstants.Tuple_FfoReportingRecipientTaskFailure, new string[]
         {
             cmdlet.Organization ?? "<NULL>",
             cmdlet.HostServerName ?? "<NULL>",
             cmdlet.ToString() ?? "<NULL>",
             cmdlet.AdditionalHeaders.ToString() ?? "<NULL>",
             (cmdlet.RequestTimeout != null) ? cmdlet.RequestTimeout.Value.ToString() : "<NULL>",
             cmdlet.Exception.ToString() ?? "<NULL>"
         });
         task.WriteError(cmdlet.Exception, ErrorCategory.InvalidOperation, null);
     }
 }
Esempio n. 5
0
 public static void SetProperty(PswsCmdlet cmdlet, string propertyName, CountryInfo propertyValue)
 {
     ArgumentValidator.ThrowIfNull("cmdlet", cmdlet);
     if (propertyValue != null)
     {
         cmdlet.Parameters[propertyName] = propertyValue;
     }
 }
Esempio n. 6
0
 public static void SetProperty(PswsCmdlet cmdlet, string propertyName, ProxyAddress propertyValue)
 {
     ArgumentValidator.ThrowIfNull("cmdlet", cmdlet);
     if (propertyValue != null)
     {
         cmdlet.Parameters[propertyName] = propertyValue.ProxyAddressString;
     }
 }
Esempio n. 7
0
 public static void SetProperty(PswsCmdlet cmdlet, string propertyName, string propertyValue)
 {
     ArgumentValidator.ThrowIfNull("cmdlet", cmdlet);
     if (!string.IsNullOrEmpty(propertyValue))
     {
         cmdlet.Parameters[propertyName] = propertyValue;
     }
 }