Esempio n. 1
0
        public static void Load()
        {
            while (loaders.Count > 0)
            {
                InvokeInfo invokeInfo = loaders.Dequeue();
                Object     obj;
                if (!allComponents.TryGetValue(invokeInfo.id, out obj))
                {
                    continue;
                }
                if (obj.IsDisposed)
                {
                    continue;
                }

                tempLoaders.Enqueue(invokeInfo);
                try
                {
                    invokeInfo.invoke(obj, null);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }

            SwapHelper.Swap(ref loaders, ref tempLoaders);
        }
Esempio n. 2
0
        private static void Start()
        {
            while (starts.Count > 0)
            {
                InvokeInfo invokeInfo = starts.Dequeue();
                Object     obj;
                if (!allComponents.TryGetValue(invokeInfo.id, out obj))
                {
                    continue;
                }

                try
                {
                    invokeInfo.invoke(obj, null);
                }
                catch (Exception e)
                {
                    Log.Error(e);
                }
            }
        }