Skip to content

Commit

Permalink
Allow Getter method to be injected
Browse files Browse the repository at this point in the history
Allow getter method to be injected
  • Loading branch information
punitganshani committed Feb 19, 2015
1 parent 05d1c85 commit 175fc80
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 682 deletions.
4 changes: 2 additions & 2 deletions CInject.Engine/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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.4")]
[assembly: AssemblyFileVersion("1.4")]
[assembly: AssemblyVersion("1.4.1")]
[assembly: AssemblyFileVersion("1.4.1")]
3 changes: 1 addition & 2 deletions CInject.Engine/Resolvers/MonoAssemblyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,8 @@ private bool PatchMethod(MethodDefinition method, Injection injection)
bool success = true;
if (method.IsConstructor ||
method.IsAbstract ||
method.IsGetter ||
method.IsSetter ||
method.IsSpecialName ||
(method.IsSpecialName && !method.IsGetter) || // to allow getter methods
method.IsGenericInstance ||
method.IsManaged == false ||
method.Body == null)
Expand Down
4 changes: 2 additions & 2 deletions CInject.Injections/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.4")]
[assembly: AssemblyFileVersion("1.4")]
[assembly: AssemblyVersion("1.4.1")]
[assembly: AssemblyFileVersion("1.4.1")]
Binary file not shown.
1 change: 1 addition & 0 deletions CInject.TargetAssembly/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ private static void Main(string[] args)
TestClass.MyDelegate delegateDefinition = new TestClass.MyDelegate(DelegateCalled);
testClass.CallDelegate(delegateDefinition);

Console.WriteLine("Name is: " + testClass.NameProperty);
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
Expand Down
8 changes: 8 additions & 0 deletions CInject.TargetAssembly/TestClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,13 @@ public double Subtract(double x, double y)
{
return x - y;
}

public string NameProperty
{
get
{
return Name;
}
}
}
}
4 changes: 2 additions & 2 deletions CInject/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.4")]
[assembly: AssemblyFileVersion("1.4")]
[assembly: AssemblyVersion("1.4.1")]
[assembly: AssemblyFileVersion("1.4.1")]
674 changes: 0 additions & 674 deletions License/gpl.txt

This file was deleted.

0 comments on commit 175fc80

Please sign in to comment.