public ENCollection ListNotebooks(bool callingFromCOM)
		{
			List<ENNotebook> results = ENSession.SharedSession.ListNotebooks();

			ENCollection comResults = new ENCollection();
            foreach (ENNotebook result in results)
            {
                object tempvar = result;
                comResults.Add(ref tempvar);
            }
            //foreach (var result in results)
            //{
            //    var tempVar = result;
            //    comResults.Add(ref tempVar);
            //}
            ////foreach (var result in results)
            ////{
            ////    object null_object = null;
            ////    object null_object2 = null;
            ////    object null_object3 = null;
            ////    object temp_object = result;
            ////    comResults.Add(ref temp_object, ref null_object, ref null_object2, ref null_object3);
            ////}
			return comResults;
		}
		public ENCollection ListNotebooksForCOM()
		{
			List<ENNotebook> results = ENSession.SharedSession.ListNotebooks();

			ENCollection comResults = new ENCollection();
            foreach (ENNotebook result in results)
            {
                object tempvar = result;
                object tempkey = result.Guid;
                comResults.Add(ref tempvar, ref tempkey);
            }
			return comResults;
		}
		public ENCollection FindNotes(string noteSearchString, ENNotebook notebook, SearchScope scope, SortOrder order, int maxResults)
		{
			List<ENSessionFindNotesResult> results = ENSession.SharedSession.FindNotes(ENNoteSearch.NoteSearch(noteSearchString), notebook, scope, order, maxResults);

			ENCollection comResults = new ENCollection();
            foreach (ENSessionFindNotesResult result in results)
            {
                object tempvar = result;
                comResults.Add(ref tempvar);
            }
            //foreach (var result in results)
            //{
            //    var tempVar = result;
            //    comResults.Add(ref tempVar);
            //}
            ////foreach (var result in results)
            ////{
            ////    object null_object = null;
            ////    object null_object2 = null;
            ////    object null_object3 = null;
            ////    object temp_object = result;
            ////    comResults.Add(ref temp_object, ref null_object, ref null_object2, ref null_object3);
            ////}
			return comResults;
		}
		public ENCollection FindNotesForCOM(ENNoteSearch noteSearch,  ENNotebook notebook, SearchScope scope, SortOrder order, int maxResults)
		{
            System.Windows.Forms.MessageBox.Show("Finding...", "Debug", System.Windows.Forms.MessageBoxButtons.OK);
            
            List<ENSessionFindNotesResult> results = ENSession.SharedSession.FindNotes(noteSearch, notebook, scope, order, maxResults);

            System.Windows.Forms.MessageBox.Show(results.Count.ToString(),"Debug",System.Windows.Forms.MessageBoxButtons.OK);

			ENCollection comResults = new ENCollection();
            foreach (ENSessionFindNotesResult result in results)
            {
                object tempvar = result;
                comResults.Add(ref tempvar);
            }
			return comResults;
		}