예제 #1
0
        /// <summary>
        /// Adds a new <see cref="IBinaryOperatorOverloadMember"/> with the <paramref name="side"/>,
        /// <paramref name="otherSide"/> and <paramref name="overloadedOperator"/> provided.
        /// </summary>
        /// <param name="side">The side the containing type is contained on.</param>
        /// <param name="otherSide">The other side of the operation.</param>
        /// <param name="overloadedOperator">The operator overloaded by the new <see cref="IBinaryOperatorOverloadMember"/>.</param>
        /// <returns>A new <see cref="IBinaryOperatorOverloadMember"/> implementation.</returns>
        public IBinaryOperatorOverloadMember AddNew(BinaryOperatorOverloadContainingSide side, ITypeReference otherSide, OverloadableBinaryOperators overloadedOperator)
        {
            IBinaryOperatorOverloadMember binOpOvrMember = new BinaryOperatorOverloadMember(this.TargetDeclaration);

            binOpOvrMember.ContainingSide = side;
            if (!(side == BinaryOperatorOverloadContainingSide.Both && otherSide == null))
            {
                binOpOvrMember.OtherSide = otherSide;
            }
            binOpOvrMember.Operator = overloadedOperator;
            this._Add(binOpOvrMember.GetUniqueIdentifier(), binOpOvrMember);
            return(binOpOvrMember);
        }