Пример #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 private Director()
 {
     CommonUtils.ConsoleLine("CurrentDirectory is: " + System.Environment.CurrentDirectory, "Director", OutputStyle.Normal);
     CommonUtils.ConsoleLine("BaseDirectory is: " + System.AppDomain.CurrentDomain.BaseDirectory, "Director", OutputStyle.Normal);
     this.InitConfig();
     this.resMana = ResourceManager.GetInstance();
     Director.RunMana = new RuntimeManager();
     this.updateRender = new UpdateRender();
     Director.RunMana.SetScreenManager(ScreenManager.GetInstance());
     this.timer = new DispatcherTimer();
     this.timer.Interval = TimeSpan.FromMilliseconds(GlobalDataContainer.DirectorTimerInterval);
     this.timer.Tick += UpdateContext;
     #if NOTIME
     #else
     this.timer.Start();
     this.InitRuntime();
     #endif
 }
Пример #2
0
 /// <summary>
 /// 工厂方法:获得类的唯一实例
 /// </summary>
 /// <returns>资源管理器的唯一实例</returns>
 public static ResourceManager GetInstance()
 {
     return null == synObject ? synObject = new ResourceManager() : synObject;
 }