Exemplo n.º 1
0
        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)));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 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());
            }
        }
Exemplo n.º 4
0
 public void Reset()
 {
     EverythingWrapper.Everything_Reset();
 }
Exemplo n.º 5
0
        private ErrorCode GetError()
        {
            var error = EverythingWrapper.Everything_GetLastError();

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

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