Example #1
0
        public void endLoad(Func<bool> keepRunning)
        {
            if (job == null)
            {
                throw new InvalidOperationException("You must call beginLoad before calling endLoad");
            }

            if (!loadedFromFile && !loadedFromServer)
            {
                while (keepRunning() && !loadedFromServer)
                {
                    try
                    {
                        Thread.Sleep(1000);
                    }
                    catch
                    {
                    }
                }
            }

            job = null;
        }
Example #2
0
        public void beginLoad(VaultContext context, Func<bool> keepRunning)
        {
            if (job != null)
            {
                throw new InvalidOperationException("You cannot call beginLoad twice without calling endLoad in between");
            }

            job = new InventoryRetrievalJob(context.Mapping, keepRunning);
            job.run();
        }