Kyles-Fantastic-Dialogue-System/Library/PackageCache/com.unity.quicksearch@3.0.0-preview.8/Editor/Indexing/SearchIndexer.cs
/// <summary>
/// Load asynchronously (i.e. in another thread) the index from a binary buffer.
/// </summary>
/// <param name="bytes">Binary buffer containing the index representation.</param>
/// <param name="finished">Callback that will trigger when the index is fully loaded. The callback parameters indicate if the loading was succesful.</param>
/// <returns>Returns false if the index is of an unsupported version or if there was a problem initializing the reading thread.</returns>
Load asynchronously  the index from a binary buffer.
Load asynchronously the index from a binary buffer .
public bool LoadBytes(byte[] bytes, Action<bool> finished)
        {
            using (var memoryStream = new MemoryStream(bytes))
                if (!Read(memoryStream, true))
                    return false;
            var t = new Thread(() =>
            {
                using (var memoryStream = new MemoryStream(bytes))
                {
                    var success = Read(memoryStream, false);
                    Dispatcher.Enqueue(() => finished(success));
                }
            });
            t.Start();
            return t.ThreadState != System.Threading.ThreadState.Unstarted;
        }
public bool LoadBytes ( byte [ ] bytes , Action < bool > finished ) { using ( var memoryStream = new MemoryStream ( bytes ) ) if ( ! Read ( memoryStream , true ) ) return false ; var t = new Thread ( ( ) => { using ( var memoryStream = new MemoryStream ( bytes ) ) { var success = Read ( memoryStream , false ) ; Dispatcher . Enqueue ( ( ) => finished ( success ) ) ; } } ) ; t . Start ( ) ; return t . ThreadState != System . Threading . ThreadState . Unstarted ; }
Load asynchronously (i.e.
Load asynchronously ( i . e .
Returns false if the index is of an unsupported version or if there was a problem initializing the reading thread.
Returns false if the index is of an unsupported version or if there was a problem initializing the reading thread .
bytes
byte[]
Binary buffer containing the index representation.
Binary buffer containing the index representation .
finished
Action<bool>
Callback that will trigger when the index is fully loaded. The callback parameters indicate if the loading was succesful.
Callback that will trigger when the index is fully loaded . The callback parameters indicate if the loading was succesful .