Example #1
0
        /// <summary>
        /// Adds a setting to this type
        /// </summary>
        /// <param name="myName">The name of the setting</param>
        /// <param name="mySetting">The setting itself</param>
        /// <param name="myTypeManager">The DB type manager</param>
        /// <returns>A Result type</returns>
        public Exceptional SetPersistentSetting(string myName, ADBSettingsBase mySetting, DBTypeManager myTypeManager)
        {
            if (!_TypeSettings.ContainsKey(myName))
            {
                _TypeSettings.Add(myName, (ADBSettingsBase)mySetting.Clone());
            }
            else
            {
                _TypeSettings[myName] = (ADBSettingsBase)mySetting.Clone();
            }

            var FlushExcept = myTypeManager.FlushType(this);

            if (FlushExcept.Failed())
                return new Exceptional(FlushExcept);

            return Exceptional.OK;
        }
Example #2
0
        public Exceptional SetPersistentSetting(String mySettingName, ADBSettingsBase myADBSettingsBase, DBTypeManager myDBTypeManager)
        {
            if (!_Settings.ContainsKey(mySettingName))
            {
                _Settings.Add(mySettingName, (ADBSettingsBase)myADBSettingsBase.Clone());
            }
            else
            {
                _Settings[mySettingName] = (ADBSettingsBase)myADBSettingsBase.Clone();
            }

            var FlushExcept = myDBTypeManager.FlushType(GetRelatedType(myDBTypeManager));

            if (FlushExcept.Failed())
                return new Exceptional(FlushExcept);

            return Exceptional.OK;
        }