Ejemplo n.º 1
0
        private static ITypizedNodeArray <T0, T1, T2> Typize <T0, T1, T2>(IList <INode> array)
            where T0 : INode
            where T1 : INode
            where T2 : INode
        {
            if (array == null)
            {
                return(null);
            }
            var typizedNodeArray = new TypizedNodeArray <T0, T1, T2>();

            if (!(array[0] is T0))
            {
                return(null);
            }
            typizedNodeArray.A = (T0)array[0];

            if (!(array[1] is T1))
            {
                return(null);
            }
            typizedNodeArray.B = (T1)array[1];

            if (!(array[2] is T2))
            {
                return(null);
            }
            typizedNodeArray.C = (T2)array[2];

            return(typizedNodeArray);
        }
Ejemplo n.º 2
0
        private static ITypizedNodeArray <T0, T1, T2, T3, T4, T5, T6> Typize <T0, T1, T2, T3, T4, T5, T6>(IList <INode> array)
            where T0 : INode
            where T1 : INode
            where T2 : INode
            where T3 : INode
            where T4 : INode
            where T5 : INode
            where T6 : INode
        {
            if (array == null)
            {
                return(null);
            }
            var typizedNodeArray = new TypizedNodeArray <T0, T1, T2, T3, T4, T5, T6>();

            if (!(array[0] is T0))
            {
                return(null);
            }
            typizedNodeArray.A = (T0)array[0];

            if (!(array[1] is T1))
            {
                return(null);
            }
            typizedNodeArray.B = (T1)array[1];

            if (!(array[2] is T2))
            {
                return(null);
            }
            typizedNodeArray.C = (T2)array[2];

            if (!(array[3] is T3))
            {
                return(null);
            }
            typizedNodeArray.D = (T3)array[3];

            if (!(array[4] is T4))
            {
                return(null);
            }
            typizedNodeArray.E = (T4)array[4];

            if (!(array[5] is T5))
            {
                return(null);
            }
            typizedNodeArray.F = (T5)array[5];

            if (!(array[6] is T6))
            {
                return(null);
            }
            typizedNodeArray.G = (T6)array[6];

            return(typizedNodeArray);
        }
Ejemplo n.º 3
0
        private static ITypizedNodeArray <T0> Typize <T0>(IList <INode> array)
            where T0 : INode
        {
            if (array == null)
            {
                return(null);
            }
            var typizedNodeArray = new TypizedNodeArray <T0>();

            if (!(array[0] is T0))
            {
                return(null);
            }
            typizedNodeArray.A = (T0)array[0];

            return(typizedNodeArray);
        }
Ejemplo n.º 4
0
        private static ITypizedNodeArray <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Typize <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(IList <INode> array)
            where T0 : INode
            where T1 : INode
            where T2 : INode
            where T3 : INode
            where T4 : INode
            where T5 : INode
            where T6 : INode
            where T7 : INode
            where T8 : INode
            where T9 : INode
            where T10 : INode
            where T11 : INode
        {
            if (array == null)
            {
                return(null);
            }
            var typizedNodeArray = new TypizedNodeArray <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>();

            if (!(array[0] is T0))
            {
                return(null);
            }
            typizedNodeArray.A = (T0)array[0];

            if (!(array[1] is T1))
            {
                return(null);
            }
            typizedNodeArray.B = (T1)array[1];

            if (!(array[2] is T2))
            {
                return(null);
            }
            typizedNodeArray.C = (T2)array[2];

            if (!(array[3] is T3))
            {
                return(null);
            }
            typizedNodeArray.D = (T3)array[3];

            if (!(array[4] is T4))
            {
                return(null);
            }
            typizedNodeArray.E = (T4)array[4];

            if (!(array[5] is T5))
            {
                return(null);
            }
            typizedNodeArray.F = (T5)array[5];

            if (!(array[6] is T6))
            {
                return(null);
            }
            typizedNodeArray.G = (T6)array[6];

            if (!(array[7] is T7))
            {
                return(null);
            }
            typizedNodeArray.H = (T7)array[7];

            if (!(array[8] is T8))
            {
                return(null);
            }
            typizedNodeArray.I = (T8)array[8];

            if (!(array[9] is T9))
            {
                return(null);
            }
            typizedNodeArray.J = (T9)array[9];

            if (!(array[10] is T10))
            {
                return(null);
            }
            typizedNodeArray.K = (T10)array[10];

            if (!(array[11] is T11))
            {
                return(null);
            }
            typizedNodeArray.L = (T11)array[11];

            return(typizedNodeArray);
        }