Пример #1
0
        private void UpdateWeights(IDsmRelation relation, ModifyWeight modifyWeight)
        {
            int consumerId = relation.ConsumerId;
            int providerId = relation.ProviderId;

            IDsmElement currentConsumer = _elementsDataModel.FindElementById(consumerId);

            while (currentConsumer != null)
            {
                IDsmElement currentProvider = _elementsDataModel.FindElementById(providerId);
                while (currentProvider != null)
                {
                    modifyWeight(currentConsumer.Id, currentProvider.Id, relation.Weight);
                    currentProvider = currentProvider.Parent;
                }
                currentConsumer = currentConsumer.Parent;
            }
        }
Пример #2
0
 public IDsmElement GetElementById(int id)
 {
     return(_elementsDataModel.FindElementById(id));
 }