Beispiel #1
0
 public static void Init(IInitializable initializable)
 {
     if (initializable != null)
     {
         initializable.Init();
     }
 }
Beispiel #2
0
 public static void Init(IInitializable initializable)
 {
     if (initializable != null)
     {
         initializable.Init();
     }
 }
 private void Start()
 {
     for (int i = 0; i < ScriptsToInitialiseReferences.Length; i++)
     {
         IInitializable init = (IInitializable)ScriptsToInitialiseReferences[i];
         init.Init();
     }
 }
Beispiel #4
0
 public void AddInitializable(IInitializable initializable)
 {
     _initializables?.Push(initializable);
     if (_hasBeenInitialized)
     {
         initializable.Init();
     }
 }
Beispiel #5
0
        public void EnsureCreated()
        {
            bool isCreated = context.Database.EnsureCreated();

            if (isCreated)
            {
                IInitializable initializable = context as IInitializable;

                initializable?.Init(databaseInitializer);
            }
        }
Beispiel #6
0
        public virtual void Init()
        {
            for (int i = 0; i < providers.Count; i++)
            {
                IInitializable initializable = providers[i] as IInitializable;

                if (initializable != null)
                {
                    initializable.Init();
                }
            }
        }
Beispiel #7
0
        private void DoSync(int syncType)
        {
            string className = AppEnum.GetSync(syncType);
            Type   type      = Type.GetType(className);

            if (type == null)               //如果添加新的需要同步的类,就先在数据库里增加,在没有更新程序以前,className 应该是Unknown, Type.GetType的返回就会是null。
            {
                return;
            }
            MethodInfo     method = type.GetMethod("GetInstance");
            IInitializable iInit  = (IInitializable)method.Invoke(null, null);

            iInit.Init();
            RegisterLastVersion(syncType);
        }