Topic "No Constructor for WinSCP.TransferResumeSupport"

Author Message
dotps1
[View user's profile]
Contributor
Joined: 2015-03-23
Posts: 15
Location: United States
I was working with the [WinSCP.TransferOptions] Class, i wanted to set the .ResumeSupport property. I see that that property should be of Type WinSCP.TransferResumeSupport. Which has two properties, State and Threshold, so this was my goal:
Code:

$resumeSupport = New-Object -TypeName WinSCP.TransferResumeSupport
$resumeSupport.State = 'On'
$resumeSupport.Threshold = 1000

$transferOptions = New-Object -TypeName WinSCP.TransferOptions
$transferOptions.ResumeSupport = $resumeSupport


However, for the first line i get the following error:
Code:

New-Object : A constructor was not found. Cannot find an appropriate constructor for type WinSCP.TransferResumeSupport.


I know this can be done:
Code:

$transferOptions = New-Object -TypeName WinSCP.TransferOptions
$transferOptions.ResumeSupport.State = 'On'
$transferOptions.ResumeSupport.Threshold = 1000

But i would like to be able to declare my TransferResumeSupport Object separately. Is there a reason there is no constructor for this object type?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
dotps1 wrote:
But i would like to be able to declare my TransferResumeSupport Object separately. Is there a reason there is no constructor for this object type?

The reason is that you do not need to declare the TransferResumeSupport object separately.
What do you need it for?
dotps1
[View user's profile]
Contributor
Joined: 2015-03-23
Posts: 15
Location: United States
I guess i don't really 'Need' it per say. Its just that the WinSCP.TransferOptions.ResumeSupport takes an object of Type TransferResumeSupport, So i thought i should be able to create that object, set its properties, and then use it when configuring the WinSCP.TransferOptions Object.

https://github.com/dotps1/WinSCP/issues/9
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
But the TransferOptions.ResumeSupport does not have a setter. It's a read-only property.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License