C# 如何按序号搜索笔记

C# 如何按序号搜索笔记,c#,api,evernote,C#,Api,Evernote,我使用Evernote C#API。我了解过滤器的工作原理 ENNoteStoreClient store = ENSessionAdvanced.SharedSession.PrimaryNoteStore; SyncState currentState = store.GetSyncState(); int currentUpdateCount = currentState.UpdateCount; if (curre

我使用Evernote C#API。我了解过滤器的工作原理

ENNoteStoreClient store = ENSessionAdvanced.SharedSession.PrimaryNoteStore;
            SyncState currentState = store.GetSyncState();
            int currentUpdateCount = currentState.UpdateCount;

            if (currentUpdateCount > latestUpdateCount)
            {
                latestUpdateCount = currentUpdateCount;
                // Here synchronization code
            }
我有latestUpdateCount以及如何获取序号>=此编号的便笺?

您需要使用如下代码:

List<SyncChunk> syncBlocks = new List<SyncChunk>();
int maxEntries = 250;

// These are sample filter settings; you should use what's appropriate for you based on
// what data you want returned in your note objects.
SyncChunkFilter filter = new SyncChunkFilter();
filter.IncludeNotes = true;
filter.IncludeNoteAttributes = true;
filter.IncludeNotebooks = true;
filter.IncludeTags = false;
filter.IncludeSearches = false;
filter.IncludeResources = false;
filter.IncludeLinkedNotebooks = false;
filter.IncludeExpunged = false;
filter.IncludeNoteApplicationDataFullMap = false;
filter.IncludeResourceApplicationDataFullMap = false;
filter.IncludeNoteResourceApplicationDataFullMap = false;

do
{
    SyncChunk chunk = store.getFilteredSyncChunk(currentUpdateCount, maxEntries, filter);
    if (chunk == null)
    {
        return null;      // This can happen if there is a "503 - Service unavailable" error accessing this person's Evernote info
    }
    syncBlocks.Add(chunk);
    currentUpdateCount = chunk.ChunkHighUSN;
} while (currentUpdateCount < serverSyncState.UpdateCount);

foreach (SyncChunk chunk in syncBlocks)
{
    if (chunk != null && chunk.Notes != null)
    {
        foreach (Note chunkNote in chunk.Notes)
        {
            // do something with the retrieved chunkNote object
        }
    }
}
List syncBlocks=new List();
int maxEntries=250;
//这些是样本过滤器设置;你应该根据自己的情况使用适合自己的方法
//您希望在Notes对象中返回哪些数据。
SyncChunkFilter=新的SyncChunkFilter();
filter.includes表示为真;
filter.includeAttributes=true;
filter.include=true;
filter.IncludeTags=false;
filter.IncludeSearches=false;
filter.IncludeResources=false;
filter.includeLinkedNotebook=false;
filter.IncludeExpunged=false;
filter.includeApplicationDataFullMap=false;
filter.IncludeResourceApplicationDataFullMap=false;
filter.includeResourceApplicationDataFullMap=false;
做
{
SyncChunk chunk=store.getFilteredSyncChunk(currentUpdateCount,maxEntries,filter);
if(chunk==null)
{
return null;//如果访问此人的Evernote信息时出现“503-服务不可用”错误,则可能发生这种情况
}
syncBlocks.Add(块);
currentUpdateCount=chunk.ChunkHighUSN;
}while(currentUpdateCount