コード例 #1
0
ファイル: QSettings.cs プロジェクト: sromic1990/CityBuilder
        public void removeEventListener(QSetting setting, QSettingChangedHandler handler)
        {
            int settingId = (int)setting;

            if (settingChangedHandlerList.ContainsKey(settingId) && settingChangedHandlerList[settingId] != null)
            {
                settingChangedHandlerList[settingId] -= handler;
            }
        }
コード例 #2
0
ファイル: QSettings.cs プロジェクト: sromic1990/CityBuilder
        public void addEventListener(QSetting setting, QSettingChangedHandler handler)
        {
            int settingId = (int)setting;

            if (!settingChangedHandlerList.ContainsKey(settingId))
            {
                settingChangedHandlerList.Add(settingId, null);
            }

            if (settingChangedHandlerList[settingId] == null)
            {
                settingChangedHandlerList[settingId] = handler;
            }
            else
            {
                settingChangedHandlerList[settingId] += handler;
            }
        }