Open RReverser opened 8 years ago
Right, at least some methods that receive IVector
or IVectorView
also receives normal array and we should map this properly. Unfortunately I cannot know which ones do and which ones don't. I currently can only hope every methods consistently do.
Should I allow every functions that receive IVector
/IVectorView
to also receive normal arrays?
Should I allow every functions that receive IVector/IVectorView to also receive normal arrays?
I don't really know :/ Are you aware of any exclusions?
Are you aware of any exclusions?
No. It seems I should just introduce the change and see if there are any problems as even the MSDN documents have no single comment about JS arrays :/
Yeah, I also looked through https://msdn.microsoft.com/en-us/library/hh710232%28v=vs.94%29.aspx but it doesn't clarify much.
A JavaScript value is converted to a Windows Runtime array as follows: If the value is null or undefined, it is converted to a native null. If its internal [[Class]] property is “Array”, it is copied to a native array and a reference to this array is passed. If it is a converted array, as described previously, the underlying native array is passed. Note: Passing a JavaScript array value to a Windows Runtime method causes a full copy of the array.
This does not explicitly say that every WinRT method receives JS array but I think it implies so. Thank you for the link :+1:
@SaschaNaz If I understand that text correctly, on Windows Runtime side array from JS is copied to pretty much the same as CLR Array. If that assumption is correct, all the interfaces that CLR Array is compatible with, should be compatible with JS Array as well (and those that are not, won't be compatible, too).
Long time no news, I think I will start to fix this in a week.
7/11/2016: Aww... Sorry, I've been working on other things.
Use Windows.Storage.Pickers.FileExtensionVector class? https://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.pickers.fileextensionvector.aspx
It implements IVector
I'm trying to use
fileSavePicker.fileTypeChoices.insert("Plain Text", [".txt"])
as shown in https://msdn.microsoft.com/library/windows/apps/br207871, but gettingLooks like those types are not mapped correctly.