示例#1
0
 /// <summary>
 ///    Starts a validation run for the specified object to validate.
 /// </summary>
 /// <param name="objectToValidate">The object to validate.</param>
 /// <param name="buildConfiguration">Build configuration used to create the model</param>
 public ValidationResult Validate(IObjectBase objectToValidate, IBuildConfiguration buildConfiguration)
 {
     try
     {
         _result             = new ValidationResult();
         _buildConfiguration = buildConfiguration;
         objectToValidate.AcceptVisitor(this);
         return(_result);
     }
     finally
     {
         _buildConfiguration = null;
         _result             = null;
     }
 }
 public IEnumerable <IMoBiCommand> AdjustFormulasIn(IObjectBase objectBase, IBuildingBlock buildingBlock)
 {
     _buildingBlock = buildingBlock;
     _formulaCache  = _buildingBlock.FormulaCache;
     _allCommands   = new List <IMoBiCommand>();
     _canceled      = false;
     try
     {
         objectBase.AcceptVisitor(this);
         return(_allCommands);
     }
     finally
     {
         _buildingBlock = null;
         _formulaCache  = null;
         _allCommands   = null;
     }
 }
示例#3
0
        public bool FormulaUsedIn(IObjectBase objectBase, IFormula formula)
        {
            if (formula == null)
            {
                return(false);
            }

            _formula     = formula;
            _formulaUsed = false;
            try
            {
                objectBase.AcceptVisitor(this);
                return(_formulaUsed);
            }
            finally
            {
                _formula = null;
            }
        }
示例#4
0
 public IEnumerable <SearchResult> SearchIn(IObjectBase searchTarget, IMoBiProject project)
 {
     try
     {
         _result                  = new List <SearchResult>();
         _allBuildingBlocks       = project.AllBuildingBlocks();
         _searchExpressionCreated = false;
         _localVisitor            = new LocalSearchVisitor(getSearchExpression())
         {
             CaseSensitiv = CaseSensitiv
         };
         searchTarget.AcceptVisitor(this);
         return(Result);
     }
     finally
     {
         _projectItem       = null;
         _localVisitor      = null;
         _allBuildingBlocks = null;
     }
 }
示例#5
0
 public virtual void UpdateDisplayUnitsIn(IObjectBase objectToUpdate)
 {
     objectToUpdate?.AcceptVisitor(this);
 }