Exemple #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public IDataDto ToDto()
        {
            AssertOneCommand();
            IList <IGraphElement> elems = vResult.GetGraphElementsAt(0);

            if (elems.Count == 0)
            {
                return(null);
            }

            if (elems.Count == 1)
            {
                return(DataDto.FromGraphElement(elems[0]));
            }

            throw new Exception("Expected one result, received " + elems.Count);
        }
Exemple #2
0
        /*--------------------------------------------------------------------------------------------*/
        public T ToElement <T>() where T : class, IElement, new()
        {
            IDataDto dto = ToDto();

            return(dto == null ? null : DataDto.ToElement <T>(dto));
        }
Exemple #3
0
        /*--------------------------------------------------------------------------------------------*/
        public T ToElementAt <T>(int pCommandIndex, int pResultIndex) where T : class, IElement, new()
        {
            IDataDto dto = ToDtoAt(pCommandIndex, pResultIndex);

            return(DataDto.ToElement <T>(dto));
        }
Exemple #4
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public IDataDto ToDtoAt(int pCommandIndex, int pResultIndex)
        {
            IGraphElement e = vResult.GetGraphElementsAt(pCommandIndex)[pResultIndex];

            return(DataDto.FromGraphElement(e));
        }