Exemple #1
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public HappilAssignable <TItem> Item <TIndex1, TIndex2, TItem>(IHappilOperand <TIndex1> indexArg1, IHappilOperand <TIndex2> indexArg2)
        {
            var indexerProperty = OperandType.GetProperty("Item", typeof(TItem), new[] { typeof(TIndex1), typeof(TIndex2) });

            if (indexerProperty == null)
            {
                throw new InvalidOperationException("Could not find indexer with specified types.");
            }

            return(new PropertyAccessOperand <TItem>(
                       target: this,
                       property: indexerProperty,
                       indexArguments: new IHappilOperand[] { indexArg1, indexArg2 }));
        }
Exemple #2
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public MutableOperand <TItem> Item <TIndex, TItem>(IOperand <TIndex> indexArg1)
        {
            var indexerProperty = OperandType.GetProperty("Item", typeof(TItem), new[] { typeof(TIndex) });

            if (indexerProperty == null)
            {
                throw new InvalidOperationException("Could not find indexer with specified types.");
            }

            return(new Property <TItem>(
                       target: this,
                       property: indexerProperty,
                       indexArguments: indexArg1));
        }