Permalink
Browse files

Fixed more missing binding code.

  • Loading branch information...
1 parent e73d5d2 commit 8f5b7bc427cd6316b94e9f4765e9c0939e982254 jayt committed Aug 2, 2012
@@ -40,5 +40,5 @@ open System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the ‘*’ as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[<assembly: AssemblyVersion("1.2.3.0")>]
+[<assembly: AssemblyVersion("1.2.4.0")>]
()
@@ -42,7 +42,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
#if SILVERLIGHT
-[assembly: AssemblyVersion("4.0.3.0")]
+[assembly: AssemblyVersion("4.0.4.0")]
#else
-[assembly: AssemblyVersion("4.0.3.*")]
+[assembly: AssemblyVersion("4.0.4.*")]
#endif
@@ -24,6 +24,8 @@
using ImpromptuInterface.Dynamic;
using Microsoft.CSharp.RuntimeBinder;
using ImpromptuInterface.InvokeExt;
+using ImpromptuInterface.Internal.Support;
+
namespace ImpromptuInterface.MVVM
{
/// <summary>
@@ -205,7 +207,7 @@ public static object GenerateEventHandler(Type delType, string memberName)
/// <summary>
/// Helper Object to create event bindings.
/// </summary>
- public class EventBinder:DynamicObject
+ public class EventBinder:DynamicObject, ICustomTypeProvider
{
/// <summary>
/// Gets or sets the target.
@@ -227,6 +229,18 @@ public EventBinder(object target)
}
+#if SILVERLIGHT5
+
+ /// <summary>
+ /// Gets the custom Type.
+ /// </summary>
+ /// <returns></returns>
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
+
/// <summary>
/// Registers the events on the specified source.
/// </summary>
@@ -11,13 +11,14 @@
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
-
+using System.Reflection;
+using ImpromptuInterface.Internal.Support;
namespace ImpromptuInterface.MVVM
{
/// <summary>
/// Proxy that gives a syntax for setting property changes calls for specific properties.
/// </summary>
- public class FireOnPropertyChanged : DynamicObject
+ public class FireOnPropertyChanged : DynamicObject, ICustomTypeProvider
{
protected readonly INotifyPropertyChanged Parent;
@@ -34,6 +35,19 @@ public FireOnPropertyChanged(INotifyPropertyChanged parent)
}
+
+#if SILVERLIGHT5
+
+ /// <summary>
+ /// Gets the custom Type.
+ /// </summary>
+ /// <returns></returns>
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
+
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
PropertyChangedEventHandler tHandler;
@@ -2,13 +2,14 @@
using System.Collections.Generic;
using System.Dynamic;
using ImpromptuInterface.Dynamic;
-
+using ImpromptuInterface.Internal.Support;
+using System.Reflection;
namespace ImpromptuInterface.MVVM
{
/// <summary>
/// Trampoline object to give access to methods as Commands of original viewmodal
/// </summary>
- public class ImpromptuCommandBinder : DynamicObject
+ public class ImpromptuCommandBinder : DynamicObject,ICustomTypeProvider
{
private readonly object _parent;
@@ -23,6 +24,19 @@ internal ImpromptuCommandBinder(object viewModel, ISetupViewModel setup = null)
_setup = setup;
}
+
+#if SILVERLIGHT5
+
+ /// <summary>
+ /// Gets the custom Type.
+ /// </summary>
+ /// <returns></returns>
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
+
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
result = this[binder.Name];
@@ -13,7 +13,8 @@
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using ImpromptuInterface.Dynamic;
-
+using ImpromptuInterface.Internal.Support;
+using System.Reflection;
namespace ImpromptuInterface.MVVM
{
public partial class ImpromptuViewModel
@@ -23,7 +24,7 @@ public partial class ImpromptuViewModel
/// Trampoline object to choose property
/// </summary>
[Obsolete]
- public class PropertyDepends : DynamicObject
+ public class PropertyDepends : DynamicObject,ICustomTypeProvider
{
private readonly ImpromptuViewModel _parent;
@@ -43,9 +44,22 @@ public override bool TryGetMember(GetMemberBinder binder, out object result)
return true;
}
+
+
+#if SILVERLIGHT5
+
+ /// <summary>
+ /// Gets the custom Type.
+ /// </summary>
+ /// <returns></returns>
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
}
- public class PropertyDepend : DynamicObject
+ public class PropertyDepend : DynamicObject, ICustomTypeProvider
{
private readonly ImpromptuViewModel _parent;
private readonly FireOnPropertyChangedDependencyAware _onChange;
@@ -69,9 +83,20 @@ public override bool TryGetMember(GetMemberBinder binder, out object result)
}
+#if SILVERLIGHT5
+
+ /// <summary>
+ /// Gets the custom Type.
+ /// </summary>
+ /// <returns></returns>
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
}
- public class DependObject : Object
+ public class DependObject : Object, ICustomTypeProvider
{
private readonly ImpromptuViewModel _parent;
private readonly string _property;
@@ -117,10 +142,23 @@ public IEnumerable<string> List
return _parent.LinkedProperties.Where(it => it.Value.Contains(_property)).Select(it => it.Key);
}
}
+
+
+#if SILVERLIGHT5
+
+ /// <summary>
+ /// Gets the custom Type.
+ /// </summary>
+ /// <returns></returns>
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
}
- public abstract class DependencyBase : DynamicObject
+ public abstract class DependencyBase : DynamicObject, ICustomTypeProvider
{
protected readonly ImpromptuViewModel _parent;
protected readonly string _property;
@@ -152,6 +190,17 @@ public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, o
return true;
}
+#if SILVERLIGHT5
+
+ /// <summary>
+ /// Gets the custom Type.
+ /// </summary>
+ /// <returns></returns>
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
}
public class Dependency : DependencyBase
@@ -189,7 +238,7 @@ protected override void Finish()
/// Trampoline object to add dependency
/// </summary>
[Obsolete]
- public class DependsOn : DynamicObject
+ public class DependsOn : DynamicObject,ICustomTypeProvider
{
private readonly ImpromptuViewModel _parent;
private readonly string _property;
@@ -211,6 +260,19 @@ public override IEnumerable<string> GetDynamicMemberNames()
{
return _parent.LinkedProperties.Where(it => it.Value.Contains(_property)).Select(it=>it.Key);
}
+
+
+#if SILVERLIGHT5
+
+ /// <summary>
+ /// Gets the custom Type.
+ /// </summary>
+ /// <returns></returns>
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
}
/// <summary>
@@ -59,10 +59,10 @@
#if SILVERLIGHT
-[assembly: AssemblyVersion("6.0.3.0")]
+[assembly: AssemblyVersion("6.0.4.0")]
#else
-[assembly: AssemblyVersion("6.0.3.*")]
+[assembly: AssemblyVersion("6.0.4.*")]
#endif
@@ -18,8 +18,9 @@
using System.Dynamic;
using System.Linq;
using System.Text;
+using ImpromptuInterface.Internal.Support;
using ImpromptuInterface.Optimization;
-
+using System.Reflection;
namespace ImpromptuInterface.Dynamic
{
@@ -259,7 +260,7 @@ public dynamic ObjectSetup(Func<object[]> constructorArgsFactory)
///<summary>
/// Trampoline for builder
///</summary>
- public class BuilderTrampoline:DynamicObject
+ public class BuilderTrampoline:DynamicObject,ICustomTypeProvider
{
ImpromptuBuilder<TObjectProtoType> _buider;
@@ -281,12 +282,18 @@ public override bool TryInvoke(InvokeBinder binder, object[] args, out object re
result = InvokeHelper(binder.CallInfo, args, tBuildType);
return true;
}
+#if SILVERLIGHT5
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
}
/// <summary>
/// Trampoline for setup builder
/// </summary>
- public class SetupTrampoline:DynamicObject
+ public class SetupTrampoline : DynamicObject, ICustomTypeProvider
{
ImpromptuBuilder<TObjectProtoType> _buider;
@@ -310,6 +317,12 @@ public override bool TryInvoke(InvokeBinder binder, dynamic[] args, out object r
result = _buider;
return true;
}
+#if SILVERLIGHT5
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
}
public override bool TrySetMember(SetMemberBinder binder, dynamic value){
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
+using System.Reflection;
using System.Runtime.Serialization;
using System.Text;
using ImpromptuInterface.Internal.Support;
@@ -47,7 +48,7 @@ public dynamic @new
/// <summary>
/// Forward argument to constructor including named arguments
/// </summary>
- public class ConstructorForward:DynamicObject
+ public class ConstructorForward:DynamicObject,ICustomTypeProvider
{
private readonly Type _type;
internal ConstructorForward(Type type)
@@ -59,6 +60,12 @@ public override bool TryInvoke(InvokeBinder binder, object[] args, out object re
result = Impromptu.InvokeConstructor(_type, Util.NameArgsIfNecessary(binder.CallInfo, args));
return true;
}
+#if SILVERLIGHT5
+ public Type GetCustomType()
+ {
+ return this.GetDynamicCustomType();
+ }
+#endif
}
/// <summary>
@@ -213,7 +213,7 @@ public virtual bool TryTypeForName(string name, out Type returnType)
/// <returns></returns>
public Type GetCustomType()
{
- return new ImpromptuRuntimeType(GetType(), this);
+ return this.GetDynamicCustomType();
}
#endif
}
Oops, something went wrong.

0 comments on commit 8f5b7bc

Please sign in to comment.