Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindAssignment C# (CSharp) Method

BindAssignment() private method

private BindAssignment ( DynamicMetaObjectBinder payload, ArgumentObject arguments, LocalVariableSymbol>.Dictionary dictionary ) : EXPR
payload System.Dynamic.DynamicMetaObjectBinder
arguments ArgumentObject
dictionary LocalVariableSymbol>.Dictionary
return Microsoft.CSharp.RuntimeBinder.Semantics.EXPR
        private EXPR BindAssignment(
            DynamicMetaObjectBinder payload,
            ArgumentObject[] arguments,
            Dictionary<int, LocalVariableSymbol> dictionary)
        {
            if (arguments.Length < 2)
            {
                throw Error.BindBinaryAssignmentRequireTwoArguments();
            }
            string name = GetName(payload);

            // Find the lhs and rhs.
            EXPR indexerArguments = null;
            bool bIsCompound = false;

            if (payload is CSharpSetIndexBinder)
            {
                // Get the list of indexer arguments - this is the list of arguments minus the last one.
                indexerArguments = CreateArgumentListEXPR(arguments, dictionary, 1, arguments.Length - 1);
                bIsCompound = (payload as CSharpSetIndexBinder).IsCompoundAssignment;
            }
            else
            {
                bIsCompound = (payload as CSharpSetMemberBinder).IsCompoundAssignment;
            }
            _symbolTable.PopulateSymbolTableWithName(name, null, arguments[0].Type);
            EXPR lhs = BindProperty(payload, arguments[0], dictionary[0], indexerArguments, false);

            int indexOfLast = arguments.Length - 1;
            EXPR rhs = CreateArgumentEXPR(arguments[indexOfLast], dictionary[indexOfLast]);

            if (arguments[0] == null)
            {
                throw Error.BindBinaryAssignmentFailedNullReference();
            }

            return _binder.bindAssignment(lhs, rhs, bIsCompound);
        }
        #endregion