Пример #1
0
 internal MonadConnectionInfo(Uri server, string certificateThumbprint, string shellUri, bool skipCerificateChecks) : base(server, certificateThumbprint, shellUri, null, AuthenticationMechanism.Default, true, 0)
 {
     this.serverUri = server;
     if (MonadConnectionInfo.exchangeClientVersion != null)
     {
         this.serverUri = MonadConnectionInfo.AppendUriProperty(this.serverUri, "ExchClientVer", MonadConnectionInfo.exchangeClientVersion);
     }
 }
 public MonadMediatorPoolKey(MonadConnectionInfo connectionInfo, RunspaceServerSettingsPresentationObject serverSettings)
 {
     if (connectionInfo == null)
     {
         throw new ArgumentNullException("connectionInfo");
     }
     this.connectionInfo = connectionInfo;
     this.serverSettings = serverSettings;
 }
 private static bool EqualCredentials(MonadConnectionInfo connInfo, MonadConnectionInfo otherConnInfo)
 {
     if (!string.IsNullOrEmpty(connInfo.CertificateThumbprint) || !string.IsNullOrEmpty(otherConnInfo.CertificateThumbprint))
     {
         return(string.Equals(connInfo.CertificateThumbprint, otherConnInfo.CertificateThumbprint));
     }
     if (connInfo.AuthenticationMechanism != otherConnInfo.AuthenticationMechanism)
     {
         return(false);
     }
     if (connInfo.Credentials != null && otherConnInfo.Credentials != null)
     {
         return(string.Equals(connInfo.Credentials.UserName, otherConnInfo.Credentials.UserName, StringComparison.OrdinalIgnoreCase));
     }
     return(connInfo.Credentials == null && otherConnInfo.Credentials == null);
 }
Пример #4
0
        public MonadConnectionInfo(Uri server, PSCredential credentials, string shellUri, string typesFile, AuthenticationMechanism authenticationMechanism, ExchangeRunspaceConfigurationSettings.SerializationLevel serializationLevel, ExchangeRunspaceConfigurationSettings.ExchangeApplication clientApplication, string clientVersion, int maxRedirectionCount, bool skipCertificateCheck) : base(server, credentials, shellUri, typesFile, authenticationMechanism, skipCertificateCheck, maxRedirectionCount)
        {
            Uri uri = server;

            if (serializationLevel != ExchangeRunspaceConfigurationSettings.SerializationLevel.Partial)
            {
                uri = MonadConnectionInfo.AppendUriProperty(uri, "serializationLevel".ToString(), serializationLevel.ToString());
            }
            if (clientApplication != ExchangeRunspaceConfigurationSettings.ExchangeApplication.Unknown)
            {
                uri = MonadConnectionInfo.AppendUriProperty(uri, "clientApplication".ToString(), clientApplication.ToString());
            }
            if (MonadConnectionInfo.exchangeClientVersion != null)
            {
                uri = MonadConnectionInfo.AppendUriProperty(uri, "ExchClientVer", MonadConnectionInfo.exchangeClientVersion);
            }
            this.serverUri          = uri;
            this.clientApplication  = clientApplication;
            this.serializationLevel = serializationLevel;
            this.clientVersion      = clientVersion;
        }
 public MonadMediatorPoolKey(MonadConnectionInfo connectionInfo) : this(connectionInfo, null)
 {
 }
Пример #6
0
 // Token: 0x0600100B RID: 4107 RVA: 0x00030C2C File Offset: 0x0002EE2C
 public MonadConnection(string connectionString, CommandInteractionHandler uiHandler, RunspaceServerSettingsPresentationObject serverSettings, MonadConnectionInfo connectionInfo)
 {
     this.SyncRoot = new object();
     base..ctor();
     ExTraceGlobals.IntegrationTracer.Information <string>((long)this.GetHashCode(), "new MonadConnection({0})", connectionString);
     if (uiHandler == null)
     {
         throw new ArgumentNullException("uiHandler");
     }
     if (string.IsNullOrEmpty(connectionString))
     {
         throw new ArgumentException("Argument 'connectionString' was null or emtpy.");
     }
     this.pooled             = true;
     this.timeout            = 0;
     this.ConnectionString   = connectionString;
     this.InteractionHandler = uiHandler;
     this.state = ConnectionState.Closed;
     if (connectionInfo != null)
     {
         this.remote = true;
         if (this.pooled)
         {
             this.mediator = MonadConnection.mediatorPool.GetRunspacePooledMediatorInstance(new MonadMediatorPoolKey(connectionInfo, serverSettings));
         }
         else
         {
             this.mediator = new RunspaceMediator(new MonadRemoteRunspaceFactory(connectionInfo, serverSettings), new EmptyRunspaceCache());
         }
     }
     else if (this.pooled)
     {
         this.mediator = MonadConnection.mediatorPool.GetRunspacePooledMediatorInstance();
     }
     else
     {
         this.mediator = MonadConnection.mediatorPool.GetRunspaceNonPooledMediatorInstance();
     }
     this.serverSettings = serverSettings;
 }
Пример #7
0
 public MonadRemoteRunspaceFactory(MonadConnectionInfo connectionInfo, RunspaceServerSettingsPresentationObject serverSettings) : base(new RunspaceConfigurationFactory(), MonadHostFactory.GetInstance(), connectionInfo)
 {
     this.clientVersion  = connectionInfo.ClientVersion;
     this.serverSettings = serverSettings;
 }
Пример #8
0
 public MonadRemoteRunspaceFactory(MonadConnectionInfo connectionInfo) : this(connectionInfo, null)
 {
 }