Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ValidateParameters()

void System.IO.Pipes.NamedPipeServerStream.ValidateParameters ( string pipeName,
PipeDirection direction,
int maxNumberOfServerInstances,
PipeTransmissionMode transmissionMode,
PipeOptions options,
int inBufferSize,
int outBufferSize,
HandleInheritability inheritability )
inlineprivate

Definition at line 73 of file NamedPipeServerStream.cs.

74 {
75 if (pipeName == null)
76 {
77 throw new ArgumentNullException("pipeName");
78 }
79 if (pipeName.Length == 0)
80 {
82 }
83 if (direction < PipeDirection.In || direction > PipeDirection.InOut)
84 {
85 throw new ArgumentOutOfRangeException("direction", System.SR.ArgumentOutOfRange_DirectionModeInOutOrInOut);
86 }
87 if (transmissionMode < PipeTransmissionMode.Byte || transmissionMode > PipeTransmissionMode.Message)
88 {
89 throw new ArgumentOutOfRangeException("transmissionMode", System.SR.ArgumentOutOfRange_TransmissionModeByteOrMsg);
90 }
91 if ((options & (PipeOptions)536870911) != 0)
92 {
93 throw new ArgumentOutOfRangeException("options", System.SR.ArgumentOutOfRange_OptionsInvalid);
94 }
95 if (inBufferSize < 0)
96 {
97 throw new ArgumentOutOfRangeException("inBufferSize", System.SR.ArgumentOutOfRange_NeedNonNegNum);
98 }
99 if (outBufferSize < 0)
100 {
101 throw new ArgumentOutOfRangeException("outBufferSize", System.SR.ArgumentOutOfRange_NeedNonNegNum);
102 }
103 if ((maxNumberOfServerInstances < 1 || maxNumberOfServerInstances > 254) && maxNumberOfServerInstances != -1)
104 {
105 throw new ArgumentOutOfRangeException("maxNumberOfServerInstances", System.SR.ArgumentOutOfRange_MaxNumServerInstances);
106 }
107 if (inheritability < HandleInheritability.None || inheritability > HandleInheritability.Inheritable)
108 {
109 throw new ArgumentOutOfRangeException("inheritability", System.SR.ArgumentOutOfRange_HandleInheritabilityNoneOrInheritable);
110 }
111 if ((options & PipeOptions.CurrentUserOnly) != 0)
112 {
113 base.IsCurrentUserOnly = true;
114 }
115 }
static string ArgumentOutOfRange_OptionsInvalid
Definition SR.cs:36
static string ArgumentOutOfRange_MaxNumServerInstances
Definition SR.cs:42
static string ArgumentOutOfRange_HandleInheritabilityNoneOrInheritable
Definition SR.cs:38
static string ArgumentOutOfRange_TransmissionModeByteOrMsg
Definition SR.cs:30
static string Argument_NeedNonemptyPipeName
Definition SR.cs:18
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
static string ArgumentOutOfRange_DirectionModeInOutOrInOut
Definition SR.cs:32
Definition SR.cs:7

References System.SR.Argument_NeedNonemptyPipeName, System.SR.ArgumentOutOfRange_DirectionModeInOutOrInOut, System.SR.ArgumentOutOfRange_HandleInheritabilityNoneOrInheritable, System.SR.ArgumentOutOfRange_MaxNumServerInstances, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.SR.ArgumentOutOfRange_OptionsInvalid, System.SR.ArgumentOutOfRange_TransmissionModeByteOrMsg, and System.options.

Referenced by System.IO.Pipes.NamedPipeServerStream.NamedPipeServerStream(), and System.IO.Pipes.NamedPipeServerStream.NamedPipeServerStream().