This commit is contained in:
Jiaxin Lin 2017-12-01 14:12:45 -08:00
Родитель fc12316e96
Коммит d781b16514
2 изменённых файлов: 32 добавлений и 0 удалений

Просмотреть файл

@ -40,6 +40,7 @@ FBPaginatedArray::FBPaginatedArray(
winsdkfb::FBJsonClassFactory^ ObjectFactory
) :
_current(nullptr),
_currentDataString(nullptr),
_request(Request),
_parameters(Parameters),
_objectFactory(ObjectFactory)
@ -94,6 +95,18 @@ IVectorView<Object^>^ FBPaginatedArray::Current::get()
return _current;
}
String^ FBPaginatedArray::CurrentDataString::get()
{
IVectorView<Object^>^ result = nullptr;
if (!HasCurrent)
{
throw ref new InvalidArgumentException(SDKMessageBadCall);
}
return _currentDataString;
}
bool FBPaginatedArray::HasCurrent::get()
{
return (_current != nullptr);
@ -176,6 +189,7 @@ FBResult^ FBPaginatedArray::ConsumePagedResponse(
SDKMessageBadObject);
}
_currentDataString = it->Current->Value->ToString();
_current = ObjectArrayFromJsonArray(
it->Current->Value->GetArray(), _objectFactory);
if (_current)

Просмотреть файл

@ -110,6 +110,23 @@ namespace winsdkfb
Windows::Foundation::Collections::IVectorView<Object^>^ get();
}
/**
* The current collection of objects that were returned by a call
* to FirstAsync, NextAsync, or PreviousAsync. This is the raw string
* of the "data" value.
*/
property Platform::String^
CurrentDataString
{
/**
* Gets the current collection of objects from the most recently
* queried page, in the raw string format.
* @exception InvalidArgumentException if no page is the current page.
* @returnPlatform::String^ of the data
*/
Platform::String^ get();
}
/**
* Indicates if the Graph call successfully returned a page of data
* that was successfully converted by ObjectFactory.
@ -150,6 +167,7 @@ namespace winsdkfb
Platform::String^ path
);
Platform::String^ _currentDataString;
Windows::Foundation::Collections::IVectorView<Object^>^ _current;
FBPaging^ _paging;
Platform::String^ _request;