/// <exception cref="System.IO.IOException"></exception>
 private void Defrag(TernaryBool generateCommitTimestamp)
 {
     var config = new DefragmentConfig(SourceFile(), BackupFile());
     config.Db4oConfig(NewConfiguration());
     config.ForceBackupDelete(true);
     if (!generateCommitTimestamp.IsUnspecified())
     {
         config.Db4oConfig().GenerateCommitTimestamps(generateCommitTimestamp.DefiniteYes(
             ));
     }
     Db4o.Defragment.Defragment.Defrag(config);
 }
示例#2
0
		/// <summary>
		/// Checks if the current configuration scope is globally
		/// enabled or disabled.
		/// </summary>
		/// <remarks>
		/// Checks if the current configuration scope is globally
		/// enabled or disabled.
		/// </remarks>
		/// <param name="defaultValue">- default result</param>
		/// <returns>
		/// false if disabled, true if globally enabled, default
		/// value otherwise
		/// </returns>
		public bool ApplyConfig(TernaryBool defaultValue)
		{
			switch (_value)
			{
				case DisabledId:
				{
					return false;
				}

				case GloballyId:
				{
					return !defaultValue.DefiniteNo();
				}

				default:
				{
					return defaultValue.DefiniteYes();
					break;
				}
			}
		}
示例#3
0
		private ReflectConstructorSpec(TernaryBool canBeInstantiated)
		{
			_canBeInstantiated = canBeInstantiated;
			_constructor = null;
		}
示例#4
0
		public ReflectConstructorSpec(IReflectConstructor constructor, object[] args)
		{
			_constructor = constructor;
			_args = args;
			_canBeInstantiated = TernaryBool.Yes;
		}
示例#5
0
 public virtual bool IsStruct()
 {
     if (_isStruct == TernaryBool.Unspecified)
     {
         _isStruct = Platform4.IsStruct(ClassReflector())
             ? TernaryBool.Yes
             : TernaryBool.
                 No;
     }
     return _isStruct == TernaryBool.Yes;
 }
示例#6
0
 internal bool CanUpdateFast()
 {
     if (_canUpdateFast == TernaryBool.Unspecified)
     {
         _canUpdateFast = TernaryBool.ForBoolean(CheckCanUpdateFast());
     }
     return _canUpdateFast.BooleanValue(false);
 }
示例#7
0
 private bool Generate1(ConfigScope globalConfig, TernaryBool individualConfig)
 {
     return globalConfig.ApplyConfig(individualConfig);
 }