RemObjects Software RemObjects Software

RemObjects Script [DEPRECATED]

RemObjects Script [DEPRECATED] Commit Details

Date:2010-08-09 16:56:36 (2 years 9 months ago)
Author:Carlo Kok
Commit:55
Parents: 54
Message:41993: Script for .NET needs an icon for the ecmascriptcomponent

File differences

trunk/Source/RemObjects.Script/Common.pas
207207begin
208208  var lAttr := array of System.ComponentModel.DefaultPropertyAttribute(fInstance.Type.GetCustomAttributes(typeof(System.ComponentModel.DefaultPropertyAttribute), true));
209209  if Length(lAttr) = 0 then raise new RuntimeException(RemObjects.Script.Properties.Resources.eNoSuchFunction);
210  result := BindCall('get_'+lATtr[0].Name, false, indexes);
210  result := BindCall('get_'+lAttr[0].Name, false, indexes);
211211end;
212212
213213method TypeWrapperMetaObject.BindGetMember(binder: GetMemberBinder): DynamicMetaObject;
214214begin
215215  if Length(fInstance.Type.GetProperties(BindingFlags.Static or BindingFlags.Public) ) > 0 then
216216    result := BindCall('get_'+binder.Name, binder.IgnoreCase, [])
217  else
218    result := BindCall(binder.Name, binder.IgnoreCase, []);
217  else begin
218        var res := fInstance.Binder.GetMember(MemberRequestKind.Get, typeof(fInstance.Type), binder.Name);
219    if (res = nil) or (res.Count = 0) then
220      res := fInstance.Binder.GetMember(MemberRequestKind.InvokeMember, typeof(fInstance.Type), binder.Name);
221    
222    result := new DynamicMetaObject(Expression.Constant(res), BindingRestrictions.Empty)
223    end;
224  if assigned(result) and result.Expression.Type.IsValueType then
225    result := new DynamicMetaObject(Expression.Convert(result.Expression, typeof(Object)), result.Restrictions);
219226end;
220227
221228method TypeWrapperMetaObject.BindInvokeMember(binder: InvokeMemberBinder; args: array of DynamicMetaObject): DynamicMetaObject;
...... 
268275
269276method TypeWrapperMetaObject.BindSetMember(binder: SetMemberBinder; value: DynamicMetaObject): DynamicMetaObject;
270277begin
271  if Length(fInstance.Type.GetProperties(BindingFlags.Static or BindingFlags.Public) ) > 0 then
272    result := BindCall('set_'+binder.Name, binder.IgnoreCase, [value])
273  else
274    result := BindCall(binder.Name, binder.IgnoreCase, [value]);
278  result := BindCall('set_'+binder.Name, binder.IgnoreCase, [value]);
275279end;
276280
277281end.

Archive Download the corresponding diff file

Revision: 55