コード例 #1
0
 //---------------------------------------------------------------------
 public void RecoverSettings(AllControllers allControllers)
 {
     this.BasicSettingController         = allControllers.basicSettingController;
     this.FilterSettingController        = allControllers.filterSettingController;
     this.ImportExportSettingController  = allControllers.importExportSettingController;
     this.MiscellaneousSettingController = allControllers.miscellaneousSettingController;
 }
コード例 #2
0
        private void OnDestroy()
        {
            // Remove.
            AllControllers.Remove(this);

            // Try to unregister events
            UnRegisterEvents();
        }
コード例 #3
0
ファイル: App.cs プロジェクト: studentutu/Tetris
        public static T GetController <T>()
            where T : class, IController
        {
            T result = default;

            if (AllControllers.TryGetValue(typeof(T), out var controller))
            {
                result = controller as T;
            }
            return(result);
        }
コード例 #4
0
        //---------------------------------------------------------------------
        public void UpdateSettings(ProjectSelectionKind kind)
        {
            if (this.StartUpProjectSettingsBuilder == null)
            {
                throw new InvalidOperationException("StartUpProjectSettingsBuilder should be set.");
            }

            if (File.Exists(settingsFile))
            {
                AllControllers allControllers = JsonConvert.DeserializeObject <AllControllers>(File.ReadAllText(settingsFile));
                if (allControllers.basicSettingController.CurrentProject.Equals(this.StartUpProjectSettingsBuilder.ComputeSettings(kind).ProjectName))
                {
                    RecoverSettings(allControllers);
                    return;
                }
            }

            UpdateStartUpProject(kind);
        }
コード例 #5
0
 private void Awake() => AllControllers.Add(this);