public IFreeHierarchyObject UpdateSource(List <Info_Balance_FreeHierarchy_Description> descriptions, Dispatcher dispatcher,
                                                 Action onFieldChanged, out bool isAdded)
        {
            isAdded = false;

            //List<Info_Balance_FreeHierarchy_Description> descriptions = null;

            if (_balance != null && descriptions == null)
            {
                descriptions = ARM_Service.BL_GetFreeHierarchyBalanceDescritions(_balance.BalanceFreeHierarchy_UN);
            }

            var sections = ARM_Service.BL_GetFreeHierarchyBalanceSections(BalanceFreeHierarchyTypeID);

            if (sections == null || sections.Count == 0)
            {
                Manager.UI.ShowMessage("Не описаны разделы для данного типа баланса!");
                return(null);
            }

            var source = new List <BalanceFreeHierarchySectionRow>();
            var isExistsDescription = descriptions != null && descriptions.Count > 0;
            var tps        = EnumClientServiceDictionary.GetTps();
            var isFirst    = true;
            var isFirstRow = true;

            IFreeHierarchyObject result = null;

            foreach (var section in sections.Where(s => s.UseInTotalResult))
            {
                var row = new BalanceFreeHierarchySectionRow(section, dispatcher);
                if (isFirst)
                {
                    row.IsSelected = true;
                    isFirst        = false;
                }

                if (isExistsDescription)
                {
                    //Если есть описание данного баланса
                    foreach (var description in descriptions.Where(d => string.Equals(d.BalanceFreeHierarchySection_UN, section.BalanceFreeHierarchySection_UN)).OrderBy(d => d.SortNumber))
                    {
                        var isIntegral = false;
                        IFreeHierarchyObject hierarchyObject = null;
                        if (description.TI_ID.HasValue)
                        {
                            TInfo_TI ti;
                            if (!EnumClientServiceDictionary.TIHierarchyList.TryGetValue(description.TI_ID.Value, out ti) || ti == null)
                            {
                                continue;
                            }
                            hierarchyObject = ti;
                        }
                        if (description.IntegralTI_ID.HasValue)
                        {
                            isIntegral = true;
                            TInfo_TI ti;
                            if (!EnumClientServiceDictionary.TIHierarchyList.TryGetValue(description.IntegralTI_ID.Value, out ti) || ti == null)
                            {
                                continue;
                            }
                            hierarchyObject = ti;
                        }
                        else if (description.TP_ID.HasValue && tps != null)
                        {
                            TPoint tp;
                            if (!tps.TryGetValue(description.TP_ID.Value, out tp) || tp == null)
                            {
                                continue;
                            }
                            hierarchyObject = tp;
                        }
                        else if (!string.IsNullOrEmpty(description.Formula_UN) && EnumClientServiceDictionary.FormulasList != null)
                        {
                            var formula = EnumClientServiceDictionary.FormulasList[description.Formula_UN];
                            hierarchyObject = formula;
                        }
                        else if (!string.IsNullOrEmpty(description.OurFormula_UN))
                        {
                            TFormulaForSection formula;
                            if (!EnumClientServiceDictionary.FormulaFsk.TryGetValue(description.OurFormula_UN, out formula) || formula == null)
                            {
                                continue;
                            }
                            hierarchyObject = formula;
                        }
                        else if (!string.IsNullOrEmpty(description.ContrFormula_UN))
                        {
                            TFormulaForSection formula;
                            if (!EnumClientServiceDictionary.FormulaCA.TryGetValue(description.ContrFormula_UN, out formula) || formula == null)
                            {
                                continue;
                            }
                            hierarchyObject = formula;
                        }
                        else if (description.PTransformator_ID.HasValue)
                        {
                            var transformator = EnumClientServiceDictionary.GetOrAddTransformator(description.PTransformator_ID.Value, null);
                            hierarchyObject = transformator;
                        }
                        else if (description.PReactor_ID.HasValue)
                        {
                            var reactor = EnumClientServiceDictionary.GetOrAddReactor(description.PReactor_ID.Value, null);
                            hierarchyObject = reactor;
                        }
                        else if (description.Section_ID.HasValue)
                        {
                            var      hierarhicalSections = EnumClientServiceDictionary.GetSections();
                            TSection hierarhicalSection;
                            if (hierarhicalSections != null && hierarhicalSections.TryGetValue(description.Section_ID.Value, out hierarhicalSection))
                            {
                                hierarchyObject = hierarhicalSection;
                            }
                        }
                        else if (!string.IsNullOrEmpty(description.FormulaConstant_UN))
                        {
                            var formulaConstant = EnumClientServiceDictionary.FormulaConstantDictionary[description.FormulaConstant_UN];
                            hierarchyObject = formulaConstant;
                        }

                        if (hierarchyObject == null)
                        {
                            continue;
                        }

                        var itemRows = FindDescriptions(description, row, dispatcher);
                        if (itemRows != null)
                        {
                            itemRows.Add(new BalanceFreeHierarchyItemRow(hierarchyObject, description.ChannelType, description.Coef ?? 1, onFieldChanged,
                                                                         description.SortNumber, itemRows, isIntegral, (EnumDataSourceType?)description.DataSource_ID));
                        }

                        //Раскрываем дерево на первом объекте баланса
                        if (isFirstRow)
                        {
                            //fhTree.Dispatcher.BeginInvoke((Action)(() =>
                            //{
                            //    var freeHierTreeId = FormulaEditor_Frame.FindTreeByObjectType(hierarchyObject);
                            //    fhTree.ReloadTree(freeHierTreeId, hierarchyObject: hierarchyObject);
                            //}), DispatcherPriority.Background);

                            result = hierarchyObject;

                            isAdded    = true;
                            isFirstRow = false;
                        }
                    }
                }

                source.Add(row);
            }

            dispatcher.BeginInvoke((Action)(() => Source.AddRange(source)));

            //if (!isAdded)
            //{
            //    Task.Factory.StartNew(() =>
            //    {
            //        Thread.Sleep(100);
            //        //Раскрываем дерево на родителе баланса
            //        fhTree.Dispatcher.BeginInvoke((Action)(() =>
            //           fhTree.ExpandAndSelect(_hierarchyObject, true)), DispatcherPriority.ContextIdle);
            //    });
            //}

            return(result);
        }