Пример #1
0
        private int FindPositionIndexOf(IBusinessObject businessObject)
        {
            NodeState nodeState  = GetBusinessObjectNodeState(businessObject);
            ITreeNode parentNode = nodeState.ParentNode;
            IBusinessObjectCollection businessObjectCollection = GetNodeCollection(parentNode);

            if (businessObjectCollection == null)
            {
                return(0);
            }
            int proposedIndex = businessObjectCollection.IndexOf(businessObject);
            int actualIndex   = 0;

            for (int i = 0; i < proposedIndex; i++)
            {
                IBusinessObject nodeBo      = businessObjectCollection[i];
                NodeState       boNodeState = GetBusinessObjectNodeState(nodeBo);
                if (boNodeState.IsConnected())
                {
                    actualIndex++;
                }
            }
            return(actualIndex);
        }