@@ -176,15 +176,12 @@ public override void Execute()
176
176
/// </returns>
177
177
private PSDirectConnection UpdatePeeringOffer ( )
178
178
{
179
- if ( this . InputObject . GetType ( ) . Equals ( typeof ( PSDirectConnection ) ) )
180
- {
181
179
this . InputObject . BandwidthInMbps =
182
180
this . ValidUpgradeBandwidth ( this . InputObject . BandwidthInMbps , this . BandwidthInMbps )
183
181
? this . BandwidthInMbps
184
182
: this . InputObject . BandwidthInMbps ;
185
183
if ( this . IsValidConnection ( this . InputObject ) )
186
184
return this . InputObject ;
187
- }
188
185
189
186
throw new InvalidOperationException ( string . Format ( Resources . Error_WrongCommandForDirectObject ) ) ;
190
187
}
@@ -197,12 +194,9 @@ private PSDirectConnection UpdatePeeringOffer()
197
194
/// </returns>
198
195
private PSDirectConnection UpdateMD5Authentication ( )
199
196
{
200
- if ( this . InputObject . GetType ( ) . Equals ( typeof ( PSDirectConnection ) ) )
201
- {
202
197
this . InputObject . BgpSession . Md5AuthenticationKey = this . MD5AuthenticationKey ;
203
198
if ( this . IsValidConnection ( this . InputObject ) )
204
199
return this . InputObject ;
205
- }
206
200
207
201
throw new InvalidOperationException ( string . Format ( Resources . Error_WrongCommandForDirectObject ) ) ;
208
202
}
@@ -215,14 +209,11 @@ private PSDirectConnection UpdateMD5Authentication()
215
209
/// </returns>
216
210
private PSDirectConnection UpdateIpV4Prefix ( )
217
211
{
218
- if ( this . InputObject . GetType ( ) . Equals ( typeof ( PSDirectConnection ) ) )
219
- {
220
212
this . InputObject . BgpSession . MaxPrefixesAdvertisedV4 =
221
213
this . MaxPrefixesAdvertisedIPv4 == null ? this . InputObject . BgpSession . MaxPrefixesAdvertisedV4 : 20000 ;
222
214
this . InputObject . BgpSession . SessionPrefixV4 = this . ValidatePrefix ( this . SessionPrefixV4 , Constants . Direct ) ;
223
215
if ( this . IsValidConnection ( this . InputObject ) )
224
216
return this . InputObject ;
225
- }
226
217
227
218
throw new InvalidOperationException ( string . Format ( Resources . Error_WrongCommandForDirectObject ) ) ;
228
219
}
@@ -235,14 +226,11 @@ private PSDirectConnection UpdateIpV4Prefix()
235
226
/// </returns>
236
227
private PSDirectConnection UpdateIpV6Prefix ( )
237
228
{
238
- if ( this . InputObject . GetType ( ) . Equals ( typeof ( PSDirectConnection ) ) )
239
- {
240
229
this . InputObject . BgpSession . MaxPrefixesAdvertisedV6 =
241
230
this . MaxPrefixesAdvertisedIPv6 == null ? this . InputObject . BgpSession . MaxPrefixesAdvertisedV6 : 2000 ;
242
231
this . InputObject . BgpSession . SessionPrefixV6 = this . ValidatePrefix ( this . SessionPrefixV6 , Constants . Direct ) ;
243
232
if ( this . IsValidConnection ( this . InputObject ) )
244
233
return this . InputObject ;
245
- }
246
234
247
235
throw new InvalidOperationException ( string . Format ( Resources . Error_WrongCommandForDirectObject ) ) ;
248
236
}
0 commit comments