entity.MapForms.MapForm.LoadStringsBackgroundWorker C# (CSharp) Method

LoadStringsBackgroundWorker() private method

load strings in another thread with this method, as loading strings can be sloow
private LoadStringsBackgroundWorker ( Map map ) : void
map HaloMap.Map.Map
return void
        private void LoadStringsBackgroundWorker(Map map)
        {
            if (!this.Disposing && !this.IsDisposed)
                try
                {
                    // Wait for up to 10 seconds for map to close (if open) to avoid conflicts)
                    int count = 100;
                    while (map.isOpen)
                    {
                        Thread.Sleep(100);

                        // If time has elapsed, just forget the pre-loading of strings
                        if (count-- <= 0)
                            return;
                    }
                    // Pre-load string data
                    sSwap = new MEStringsSelector(map, this);
                }
                catch
                {
                }
        }
MapForm