@@ -15,7 +15,7 @@ namespace System.Management.Automation.Runspaces.Internal
15
15
/// PowerShell client side proxy base which handles invocation
16
16
/// of powershell on a remote machine.
17
17
/// </summary>
18
- internal class ClientRemotePowerShell : IDisposable
18
+ internal sealed class ClientRemotePowerShell : IDisposable
19
19
{
20
20
#region Tracer
21
21
@@ -902,28 +902,28 @@ private void HandleRobustConnectionNotification(
902
902
903
903
#endregion Private Methods
904
904
905
- #region Protected Members
906
-
907
- protected ObjectStreamBase inputstream ;
908
- protected ObjectStreamBase errorstream ;
909
- protected PSInformationalBuffers informationalBuffers ;
910
- protected PowerShell shell ;
911
- protected Guid clientRunspacePoolId ;
912
- protected bool noInput ;
913
- protected PSInvocationSettings settings ;
914
- protected ObjectStreamBase outputstream ;
915
- protected string computerName ;
916
- protected ClientPowerShellDataStructureHandler dataStructureHandler ;
917
- protected bool stopCalled = false ;
918
- protected PSHost hostToUse ;
919
- protected RemoteRunspacePoolInternal runspacePool ;
920
-
921
- protected const string WRITE_DEBUG_LINE = "WriteDebugLine" ;
922
- protected const string WRITE_VERBOSE_LINE = "WriteVerboseLine" ;
923
- protected const string WRITE_WARNING_LINE = "WriteWarningLine" ;
924
- protected const string WRITE_PROGRESS = "WriteProgress" ;
925
-
926
- protected bool initialized = false ;
905
+ #region Private Fields
906
+
907
+ private ObjectStreamBase inputstream ;
908
+ private ObjectStreamBase errorstream ;
909
+ private PSInformationalBuffers informationalBuffers ;
910
+ private readonly PowerShell shell ;
911
+ private readonly Guid clientRunspacePoolId ;
912
+ private bool noInput ;
913
+ private PSInvocationSettings settings ;
914
+ private ObjectStreamBase outputstream ;
915
+ private readonly string computerName ;
916
+ private ClientPowerShellDataStructureHandler dataStructureHandler ;
917
+ private bool stopCalled = false ;
918
+ private PSHost hostToUse ;
919
+ private readonly RemoteRunspacePoolInternal runspacePool ;
920
+
921
+ private const string WRITE_DEBUG_LINE = "WriteDebugLine" ;
922
+ private const string WRITE_VERBOSE_LINE = "WriteVerboseLine" ;
923
+ private const string WRITE_WARNING_LINE = "WriteWarningLine" ;
924
+ private const string WRITE_PROGRESS = "WriteProgress" ;
925
+
926
+ private bool initialized = false ;
927
927
/// <summary>
928
928
/// This queue is for the state change events that resulted in closing the underlying
929
929
/// datastructure handler. We cannot send the state back to the upper layers until
@@ -933,33 +933,20 @@ private void HandleRobustConnectionNotification(
933
933
934
934
private PSConnectionRetryStatus _connectionRetryStatus = PSConnectionRetryStatus . None ;
935
935
936
- #endregion Protected Members
936
+ #endregion Private Fields
937
937
938
938
#region IDisposable
939
939
940
940
/// <summary>
941
- /// Public interface for dispose .
941
+ /// Release all resources .
942
942
/// </summary>
943
943
public void Dispose ( )
944
944
{
945
- Dispose ( true ) ;
946
-
947
- GC . SuppressFinalize ( this ) ;
945
+ // inputstream. Dispose();
946
+ // outputstream.Dispose();
947
+ // errorstream.Dispose( );
948
948
}
949
949
950
- /// <summary>
951
- /// Release all resources.
952
- /// </summary>
953
- /// <param name="disposing">If true, release all managed resources.</param>
954
- protected void Dispose ( bool disposing )
955
- {
956
- if ( disposing )
957
- {
958
- // inputstream.Dispose();
959
- // outputstream.Dispose();
960
- // errorstream.Dispose();
961
- }
962
- }
963
950
#endregion IDisposable
964
951
}
965
952
0 commit comments