• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# NoteStore.NoteFilter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Evernote.EDAM.NoteStore.NoteFilter的典型用法代码示例。如果您正苦于以下问题:C# NoteFilter类的具体用法?C# NoteFilter怎么用?C# NoteFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NoteFilter类属于Evernote.EDAM.NoteStore命名空间,在下文中一共展示了NoteFilter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetNote

        private Note GetNote()
        {
            int pageSize = 1;

            NoteFilter filter = new NoteFilter();
            filter.Words = "intitle:\"EvernoteAPIからの検索テスト用ノート(画像あり)\"";

            NoteList notes = mNoteStore.findNotes(mAuthToken, filter, 0, pageSize);

            if (notes.TotalNotes < 1)
            {
                Console.WriteLine("エラー");
                Console.WriteLine("該当件数:" + notes.TotalNotes);
                throw new ApplicationException("ノートが取得できませんでした。");
            }

            Note note = notes.Notes[0];

            // findNotesで取得するノートには、ノートの本文やリソースが含まれていないので個別に取得しなおす。
            // 第4引数がtrueだとリソースを含んだノートが取得できる
            // 第6引数はResourceAlternateData (位置情報など)の有無
            Note fullNote = mNoteStore.getNote(mAuthToken, note.Guid,
                true, true, false, false);

            return fullNote;
        }
开发者ID:kurukurupapa,项目名称:evernote-sdk-csharp,代码行数:26,代码来源:Note001Test.cs


示例2: FindTitle

        private void FindTitle()
        {
            NoteFilter filter = new NoteFilter();
            filter.Words = "intitle:\"EvernoteAPIからの検索テスト用ノート(画像あり)\"";

            int pageSize = 10;

            NotesMetadataResultSpec spec = new NotesMetadataResultSpec();
            spec.IncludeTitle = true;

            NotesMetadataList notes = mNoteStore.findNotesMetadata(mAuthToken, filter, 0, pageSize, spec);

            WriteNoteList(notes);
        }
开发者ID:kurukurupapa,项目名称:evernote-sdk-csharp,代码行数:14,代码来源:Find003Test.cs


示例3: Run

        public void Run()
        {
            int pageSize = 10;

            NoteFilter filter = new NoteFilter();
            filter.Words = "elephant";

            NotesMetadataResultSpec spec = new NotesMetadataResultSpec();
            spec.IncludeTitle = true;

            NotesMetadataList notes = mNoteStore.findNotesMetadata(mAuthToken, filter, 0, pageSize, spec);

            Console.WriteLine("特定の単語を含むノートの検索");
            Console.WriteLine("該当件数:" + notes.TotalNotes);
            foreach (NoteMetadata note in notes.Notes)
            {
                Console.WriteLine(" * " + note.Title + ", " + note.Guid);
            }
        }
开发者ID:kurukurupapa,项目名称:evernote-sdk-csharp,代码行数:19,代码来源:Find002Test.cs


示例4: Run

        public void Run()
        {
            int pageSize = 10;

            NoteFilter filter = new NoteFilter();
            filter.Order = (int)NoteSortOrder.UPDATED;

            NotesMetadataResultSpec spec = new NotesMetadataResultSpec();
            spec.IncludeTitle = true;

            NotesMetadataList notes = mNoteStore.findNotesMetadata(mAuthToken, filter, 0, pageSize, spec);

            Console.WriteLine("最も直近に変更されたノートの検索");
            Console.WriteLine("該当件数:" + notes.TotalNotes);
            foreach (NoteMetadata note in notes.Notes)
            {
                Console.WriteLine(" * " + note.Title);
            }
        }
开发者ID:kurukurupapa,项目名称:evernote-sdk-csharp,代码行数:19,代码来源:Find001Test.cs


示例5: GetNotesMetaList

        public ISearchResults GetNotesMetaList(string searchString, NoteSortOrder sortOrder, bool ascending, int resultsPage, int pageSize)
        {
            NoteFilter noteFilter = new NoteFilter();
            noteFilter.Words = searchString;
            noteFilter.Order = (int)sortOrder;
            noteFilter.Ascending = ascending;

            NotesMetadataResultSpec resultsSpec = new NotesMetadataResultSpec();
            resultsSpec.IncludeTitle = true;
            resultsSpec.IncludeCreated = true;
            resultsSpec.IncludeNotebookGuid = true;
            resultsSpec.IncludeUpdated = true;
            resultsSpec.IncludeAttributes = true;
            resultsSpec.IncludeTagGuids = true;
            resultsSpec.IncludeContentLength = true;

            NotesMetadataList noteMetadataList;

            try {
                if (resultsPage < 1) resultsPage = 1;
                if (pageSize > 100) pageSize = 100;

                noteMetadataList = noteStore.findNotesMetadata(credentials.AuthToken, noteFilter, (resultsPage - 1) * pageSize, pageSize, resultsSpec);
            }
            catch (EDAMUserException)
            {
                throw new EvernoteServiceSDK1AuthorisationException();
            }

            List<ENNoteMetadataINoteMetadataAdapter> notesMetaWrapperList =
                noteMetadataList.Notes.ConvertAll(noteMeta => new ENNoteMetadataINoteMetadataAdapter(noteMeta));

            return new SearchResults() {
                        NotesMetadata = notesMetaWrapperList.ToList<INoteMetadata>(),
                        TotalResults = noteMetadataList.TotalNotes
                    };
        }
开发者ID:ksk100,项目名称:EverReader,代码行数:37,代码来源:EvernoteServiceSDK1.cs


示例6: send_findNotesMetadata

 public void send_findNotesMetadata(string authenticationToken, NoteFilter filter, int offset, int maxNotes, NotesMetadataResultSpec resultSpec)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("findNotesMetadata", TMessageType.Call, seqid_));
   findNotesMetadata_args args = new findNotesMetadata_args();
   args.AuthenticationToken = authenticationToken;
   args.Filter = filter;
   args.Offset = offset;
   args.MaxNotes = maxNotes;
   args.ResultSpec = resultSpec;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT || NETFX_CORE
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
开发者ID:Glympse,项目名称:evernote-sdk-csharp,代码行数:18,代码来源:NoteStore.cs


示例7: FindNotes

        public List<Note> FindNotes(string word, int pageSize)
        {
            try {
                NoteFilter filter = new NoteFilter();
                filter.Words = word;
                NotesMetadataResultSpec spec = new NotesMetadataResultSpec();
                spec.IncludeTitle = true;

                NotesMetadataList notes = mNoteStore.findNotesMetadata(mAuthToken, filter, 0, pageSize, spec);

                List<Note> list = new List<Note>();
                foreach (NoteMetadata note in notes.Notes)
                {
                    // findNotesMetadataで取得するノートには、ノートの本文やリソースが含まれていないので個別に取得しなおす。
                    // 第4引数がtrueだとリソースを含んだノートが取得できる
                    // 第6引数はResourceAlternateData (位置情報など)の有無
                    Note fullNote = mNoteStore.getNote(mAuthToken, note.Guid,
                        true, true, false, false);
                    list.Add(fullNote);
                }

                return list;
            }
            catch (EDAMUserException ex)
            {
                throw new ApplicationException("Evernoteアクセスに失敗しました。"
                    + "ErrorCode=" + ex.ErrorCode
                    + ", Parameter=" + ex.Parameter
                    + ", EvernoteHost=" + mEvernoteHost,
                    ex);
            }
        }
开发者ID:kurukurupapa,项目名称:evernote-sdk-csharp,代码行数:32,代码来源:EvernoteHelper.cs


示例8: FindNotes

		public List<ENSessionFindNotesResult> FindNotes(ENNoteSearch noteSearch, ENNotebook notebook, SearchScope scope, SortOrder order, int maxResults)
		{
			if (!IsAuthenticated)
			{
				throw new ENAuthExpiredException();
			}

			// App notebook scope is internally just an "all" search, because we don't a priori know where the app
			// notebook is. There's some room for a fast path in this flow if we have a saved linked record to a
			// linked app notebook, but that case is likely rare enough to prevent complexifying this code for.
			if (scope.HasFlag(SearchScope.AppNotebook))
			{
				scope = SearchScope.All;
			}

			// Validate the scope and sort arguments.
			if (notebook != null && scope != SearchScope.None)
			{
				ENSDKLogger.ENSDKLogError("No search scope necessary if notebook provided.");
				scope = SearchScope.None;
			}
			else if (notebook == null && scope == SearchScope.None)
			{
				ENSDKLogger.ENSDKLogError("Search scope or notebook must be specified. Defaulting to personal scope.");
				scope = SearchScope.DefaultScope;
			}

			bool requiresLocalMerge = false;
			if (scope != SearchScope.None)
			{
				// Check for multiple scopes. Because linked scope can subsume multiple linked notebooks, that *always* triggers
				// the multiple scopes. If not, then both personal and business must be set together.
				if ((scope.HasFlag(SearchScope.Personal) && scope.HasFlag(SearchScope.Business)) || scope.HasFlag(SearchScope.PersonalLinked))
				{
					// If we're asked for multiple scopes, relevance is not longer supportable (since we
					// don't know how to combine relevance on the client), so default to updated date,
					// which is probably the closest proxy to relevance.
					if (order.HasFlag(SortOrder.Relevance))
					{
						ENSDKLogger.ENSDKLogError("Cannot sort by relevance across multiple search scopes. Using update date.");
						order = (EvernoteSDK.ENSession.SortOrder)EN_FLAG_CLEAR(order, SortOrder.Relevance);
						order = (EvernoteSDK.ENSession.SortOrder)EN_FLAG_SET(order, SortOrder.RecentlyUpdated);
					}
					requiresLocalMerge = true;
				}
			}

			NotesMetadataResultSpec resultSpec = new NotesMetadataResultSpec();
			resultSpec.IncludeNotebookGuid = true;
			resultSpec.IncludeTitle = true;
			resultSpec.IncludeCreated = true;
			resultSpec.IncludeUpdated = true;
			resultSpec.IncludeUpdateSequenceNum = true;

			NoteFilter noteFilter = new NoteFilter();
			noteFilter.Words = noteSearch.SearchString;

			if (order.HasFlag(SortOrder.Title))
			{
				noteFilter.Order = (System.Int32)NoteSortOrder.TITLE;
			}
			else if (order.HasFlag(SortOrder.RecentlyCreated))
			{
				noteFilter.Order = (System.Int32)NoteSortOrder.CREATED;
			}
			else if (order.HasFlag(SortOrder.RecentlyUpdated))
			{
				noteFilter.Order = (System.Int32)NoteSortOrder.UPDATED;
			}
			else if (order.HasFlag(SortOrder.Relevance))
			{
				noteFilter.Order = (System.Int32)NoteSortOrder.RELEVANCE;
			}

			// "Normal" sort is ascending for titles, and descending for dates and relevance.
			bool sortAscending = order.HasFlag(SortOrder.Title) ? true : false;
			if (order.HasFlag(SortOrder.Reverse))
			{
				sortAscending = !sortAscending;
			}
			noteFilter.Ascending = sortAscending;

			if (notebook != null)
			{
				noteFilter.NotebookGuid = notebook.Guid;
			}

			// Set up context
			ENSessionFindNotesContext context = new ENSessionFindNotesContext();
			context.scopeNotebook = notebook;
			context.scope = scope;
			context.order = order;
			context.noteFilter = noteFilter;
			context.resultSpec = resultSpec;
			context.maxResults = maxResults;
			context.findMetadataResults = new List<NoteMetadata>();
			context.requiresLocalMerge = requiresLocalMerge;
			context.sortAscending = sortAscending;

			// If we have a scope notebook, we already know what notebook the results will appear in.
//.........这里部分代码省略.........
开发者ID:mpnow,项目名称:evernote-cloud-sdk-dotnet,代码行数:101,代码来源:ENSession.cs


示例9: RunImpl

        public static void RunImpl(object state)
        {
            // Username and password of the Evernote user account to access
            const string username = ""; // Enter your username here
            const string password = ""; // Enter your password here

            if ((ConsumerKey == String.Empty) || (ConsumerSecret == String.Empty))
            {
                ShowMessage("Please provide your API key in Sample.cs");
                return;
            }
            if ((username == String.Empty) || (password == String.Empty))
            {
                ShowMessage("Please provide your username and password in Sample.cs");
                return;
            }

            // Instantiate the libraries to connect the service
            TTransport userStoreTransport = new THttpClient(new Uri(UserStoreUrl));
            TProtocol userStoreProtocol = new TBinaryProtocol(userStoreTransport);
            UserStore.Client userStore = new UserStore.Client(userStoreProtocol);

            // Check that the version is correct
            bool versionOK =
                userStore.checkVersion("C# EDAMTest",
                   Evernote.EDAM.UserStore.Constants.EDAM_VERSION_MAJOR,
                   Evernote.EDAM.UserStore.Constants.EDAM_VERSION_MINOR);
            InvokeOnUIThread(() => ViewModel.TheViewModel.VersionOK = versionOK);
            Debug.WriteLine("Is my EDAM protocol version up to date? " + versionOK);
            if (!versionOK)
            {
                return;
            }

            // Now we are going to authenticate
            AuthenticationResult authResult;
            try
            {
                authResult = userStore.authenticate(username, password, ConsumerKey, ConsumerSecret);
            }
            catch (EDAMUserException ex)
            {
                HandleAuthenticateException(EvernoteHost, ConsumerKey, ex);
                return;
            }
            Debug.WriteLine("We are connected to the service");

            // User object received after authentication
            User user = authResult.User;
            String authToken = authResult.AuthenticationToken;
            InvokeOnUIThread(() => ViewModel.TheViewModel.AuthToken = authToken);

            Debug.WriteLine("Authentication successful for: " + user.Username);
            Debug.WriteLine("Authentication token = " + authToken);

            // Creating the URL of the NoteStore based on the user object received
            String noteStoreUrl = EDAMBaseUrl + "/edam/note/" + user.ShardId;

            TTransport noteStoreTransport = new THttpClient(new Uri(noteStoreUrl));
            TProtocol noteStoreProtocol = new TBinaryProtocol(noteStoreTransport);
            NoteStore.Client noteStore = new NoteStore.Client(noteStoreProtocol);

            // Listing all the user's notebook
            List<Notebook> notebooks = noteStore.listNotebooks(authToken);
            Debug.WriteLine("Found " + notebooks.Count + " notebooks:");
            InvokeOnUIThread(() => notebooks.ForEach(notebook => ViewModel.TheViewModel.Notebooks.Add(notebook)));

            // Find the default notebook
            Notebook defaultNotebook = notebooks.Single(notebook => notebook.DefaultNotebook);

            // Printing the names of the notebooks
            foreach (Notebook notebook in notebooks)
            {
                Debug.WriteLine("  * " + notebook.Name);
            }

            // Listing the first 10 notes in the default notebook
            NoteFilter filter = new NoteFilter { NotebookGuid = defaultNotebook.Guid };
            NoteList notes = noteStore.findNotes(authToken, filter, 0, 10);
            InvokeOnUIThread(() => notes.Notes.ForEach(note => ViewModel.TheViewModel.Notes.Add(note)));
            foreach (Note note in notes.Notes)
            {
                Debug.WriteLine("  * " + note.Title);
            }

            // Creating a new note in the default notebook
            Debug.WriteLine("Creating a note in the default notebook: " + defaultNotebook.Name);

            Note newNote = new Note
                            {
                                NotebookGuid = defaultNotebook.Guid,
                                Title = "Test note from EDAMTest.cs",
                                Content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
                                          "<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">" +
                                          "<en-note>Here's an Evernote test note<br/>" +
                                          "</en-note>"
                            };

            Note createdNote = noteStore.createNote(authToken, newNote);

//.........这里部分代码省略.........
开发者ID:sankarj,项目名称:evernote,代码行数:101,代码来源:Sample.cs


示例10: FindNoteCounts

 /// <summary>
 /// Performs a search based on a configurable filter, returning the number of Notes that would match this filter for each Notebook and Tag.
 /// </summary>
 public NoteCollectionCounts FindNoteCounts(NoteFilter filter)
 {
     lock (this)
         using (var httpClient = GetHttpClient())
         {
             return GetNoteStoreClient(httpClient).findNoteCounts(this.authToken, filter);
         }
 }
开发者ID:trayburn,项目名称:EverGTD,代码行数:11,代码来源:NoteStoreWrapper.cs


示例11: send_findNoteCounts

 public IAsyncResult send_findNoteCounts(AsyncCallback callback, object state, string authenticationToken, NoteFilter filter, bool withTrash)
开发者ID:Glympse,项目名称:evernote-sdk-csharp,代码行数:1,代码来源:NoteStore.cs


示例12: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.String) {
           AuthenticationToken = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           Filter = new NoteFilter();
           Filter.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.Bool) {
           WithTrash = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:Glympse,项目名称:evernote-sdk-csharp,代码行数:42,代码来源:NoteStore.cs


示例13: Read

 public void Read(TProtocol iprot)
 {
     TField field;
     iprot.ReadStructBegin();
     while (true)
     {
       field = iprot.ReadFieldBegin();
       if (field.Type == TType.Stop) {
     break;
       }
       switch (field.ID)
       {
     case 1:
       if (field.Type == TType.String) {
     this.authenticationToken = iprot.ReadString();
     this.__isset.authenticationToken = true;
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     case 2:
       if (field.Type == TType.Struct) {
     this.filter = new NoteFilter();
     this.filter.Read(iprot);
     this.__isset.filter = true;
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     case 3:
       if (field.Type == TType.I32) {
     this.offset = iprot.ReadI32();
     this.__isset.offset = true;
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     case 4:
       if (field.Type == TType.I32) {
     this.maxNotes = iprot.ReadI32();
     this.__isset.maxNotes = true;
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     default:
       TProtocolUtil.Skip(iprot, field.Type);
       break;
       }
       iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
 }
开发者ID:trayburn,项目名称:EverGTD,代码行数:53,代码来源:NoteStore.cs


示例14: findNotes

 public NoteList findNotes(string authenticationToken, NoteFilter filter, int offset, int maxNotes)
 {
     send_findNotes(authenticationToken, filter, offset, maxNotes);
     return recv_findNotes();
 }
开发者ID:trayburn,项目名称:EverGTD,代码行数:5,代码来源:NoteStore.cs


示例15: findNoteCounts

 public NoteCollectionCounts findNoteCounts(string authenticationToken, NoteFilter filter)
 {
     send_findNoteCounts(authenticationToken, filter);
     return recv_findNoteCounts();
 }
开发者ID:trayburn,项目名称:EverGTD,代码行数:5,代码来源:NoteStore.cs


示例16: send_findNotes

 public void send_findNotes(string authenticationToken, NoteFilter filter, int offset, int maxNotes)
 {
     oprot_.WriteMessageBegin(new TMessage("findNotes", TMessageType.Call, seqid_));
     findNotes_args args = new findNotes_args();
     args.AuthenticationToken = authenticationToken;
     args.Filter = filter;
     args.Offset = offset;
     args.MaxNotes = maxNotes;
     args.Write(oprot_);
     oprot_.WriteMessageEnd();
     oprot_.Transport.Flush();
 }
开发者ID:trayburn,项目名称:EverGTD,代码行数:12,代码来源:NoteStore.cs


示例17: send_findNoteCounts

 public void send_findNoteCounts(string authenticationToken, NoteFilter filter)
 {
     oprot_.WriteMessageBegin(new TMessage("findNoteCounts", TMessageType.Call, seqid_));
     findNoteCounts_args args = new findNoteCounts_args();
     args.AuthenticationToken = authenticationToken;
     args.Filter = filter;
     args.Write(oprot_);
     oprot_.WriteMessageEnd();
     oprot_.Transport.Flush();
 }
开发者ID:trayburn,项目名称:EverGTD,代码行数:10,代码来源:NoteStore.cs


示例18: Begin_findNoteCounts

 public IAsyncResult Begin_findNoteCounts(AsyncCallback callback, object state, string authenticationToken, NoteFilter filter, bool withTrash)
 {
   return send_findNoteCounts(callback, state, authenticationToken, filter, withTrash);
 }
开发者ID:Glympse,项目名称:evernote-sdk-csharp,代码行数:4,代码来源:NoteStore.cs


示例19: findNoteCounts

      public NoteCollectionCounts findNoteCounts(string authenticationToken, NoteFilter filter, bool withTrash)
      {
        #if !SILVERLIGHT && !NETFX_CORE
        send_findNoteCounts(authenticationToken, filter, withTrash);
        return recv_findNoteCounts();

        #else
        var asyncResult = Begin_findNoteCounts(null, null, authenticationToken, filter, withTrash);
        return End_findNoteCounts(asyncResult);

        #endif
      }
开发者ID:Glympse,项目名称:evernote-sdk-csharp,代码行数:12,代码来源:NoteStore.cs


示例20: Begin_findNoteOffset

 public IAsyncResult Begin_findNoteOffset(AsyncCallback callback, object state, string authenticationToken, NoteFilter filter, string guid)
 {
   return send_findNoteOffset(callback, state, authenticationToken, filter, guid);
 }
开发者ID:Glympse,项目名称:evernote-sdk-csharp,代码行数:4,代码来源:NoteStore.cs



注:本文中的Evernote.EDAM.NoteStore.NoteFilter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Reading.DICOMBinaryReader类代码示例发布时间:2022-05-24
下一篇:
C# EntityManagement.HttpEntityManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap