/* * Copyright © 2011, Petro Protsyk, Denys Vuika * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Reflection; namespace Scripting.SSharp.Runtime.Promotion { /// /// Public interface for Object Bind. It is used to bind arguments to: /// * indexers /// * constructors /// * methods /// * interfaces /// public interface IObjectBinding { /// /// Binds to constructor /// /// /// /// IBinding BindToConstructor(Type target, object[] arguments); /// /// Binds to method /// /// /// /// /// /// IBinding BindToMethod(object target, string methodName, Type[] genericParameters, object[] arguments); /// /// Binds to method /// /// /// /// /// IBinding BindToMethod(object target, MethodInfo method, object[] arguments); /// /// Binds to indexer /// /// /// /// /// IBinding BindToIndex(object target, object[] arguments, bool setter); /// /// Binds to Field, Property of Event of a given object /// /// /// /// IMemberBinding BindToMember(object target, string memberName, bool throwNotFound); /// /// Converts value to target type /// /// /// /// object ConvertTo(object value, Type targetType); /// /// Evaluates if object binder could run binding procedure for the given member. /// Default object binders uses BindableAttribute. /// /// /// bool CanBind(MemberInfo member); } }