using System;
using System.Collections.Generic;
using System.Text;

namespace FormulaEditor
{
    public class StringConcatOperation : IObjectOperation, IBinaryAcceptor
    {

        static public readonly StringConcatOperation Object =
            new StringConcatOperation();

        protected StringConcatOperation()
        {
        }

 
        #region IObjectOperation Members

        int IObjectOperation.Arity
        {
            get { return 2; }
        }

        object IObjectOperation.this[object[] x]
        {
            get
            {
                string s = "" + x[0] + x[1];
                return s;
            }
        }

        object IObjectOperation.ReturnType
        {
            get { return ""; }
        }

        bool IObjectOperation.IsPowered
        {
            get { return false; }
        }

        #endregion


        #region IBinaryAcceptor Members

        IObjectOperation IBinaryAcceptor.Accept(object typeA, object typeB)
        {
            if (typeA.Equals("") && typeB.Equals(""))
            {
                return this;
            }
            return null;
        }

        #endregion
}
}
