public static Version GetVersion()
        {
            UInt32 major    = EverythingWrapper.Everything_GetMajorVersion();
            UInt32 minor    = EverythingWrapper.Everything_GetMinorVersion();
            UInt32 build    = EverythingWrapper.Everything_GetBuildNumber();
            UInt32 revision = EverythingWrapper.Everything_GetRevision();

            return(new Version(Convert.ToInt32(major), Convert.ToInt32(minor), Convert.ToInt32(build), Convert.ToInt32(revision)));
        }
        private DateTime GenericDate(MyDelegate func, Func <string, DateTime> fallbackDelegate)
        {
            EverythingWrapper.Everything_SetReplyID(this.replyId);
            if (func(this.index, out var date) && date >= 0)
            {
                return(DateTime.FromFileTime(date));
            }

            return(!string.IsNullOrEmpty(this.FullPath)
        ? fallbackDelegate(this.FullPath)
        : DateTime.MinValue);
        }
Beispiel #3
0
        IEnumerable <ISearchResult> IEverythingInternal.SendSearch(string searchPattern, RequestFlags flags)
        {
            using (EverythingWrapper.Lock())
            {
                EverythingWrapper.Everything_SetReplyID(this.replyId);
                EverythingWrapper.Everything_SetMatchWholeWord(this.MatchWholeWord);
                EverythingWrapper.Everything_SetMatchPath(this.MatchPath);
                EverythingWrapper.Everything_SetMatchCase(this.MatchCase);
                EverythingWrapper.Everything_SetRequestFlags((uint)flags | DefaultSearchFlags);
                searchPattern = this.ApplySearchResultKind(searchPattern);
                EverythingWrapper.Everything_SetSearch(searchPattern);

                if (this.SortKey != SortingKey.None)
                {
                    EverythingWrapper.Everything_SetSort((uint)this.SortKey);
                }

                EverythingWrapper.Everything_Query(true);

                this.LastErrorCode = this.GetError();

                return(this.GetResults());
            }
        }
Beispiel #4
0
 public void Reset()
 {
     EverythingWrapper.Everything_Reset();
 }
Beispiel #5
0
        private ErrorCode GetError()
        {
            var error = EverythingWrapper.Everything_GetLastError();

            return((ErrorCode)error);
        }
Beispiel #6
0
        private IEnumerable <ISearchResult> GetResults()
        {
            var numResults = EverythingWrapper.Everything_GetNumResults();

            return(Enumerable.Range(0, (int)numResults).Select(x => new SearchResult(x, this.replyId)));
        }
 public static ErrorCode GetLastError()
 {
     return((ErrorCode)EverythingWrapper.Everything_GetLastError());
 }
 public static bool IsReady()
 {
     return(EverythingWrapper.Everything_IsDBLoaded());
 }