This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8" ?> | |
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <PropertyGroup> | |
| <PostSharpAssemblyBindingPolicySet>Silverlight20</PostSharpAssemblyBindingPolicySet> | |
| </PropertyGroup> | |
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public override bool OnCreateOptionsMenu(IMenu menu) | |
| { | |
| var item = menu.Add(0,1,1,"Refresh"); | |
| item.SetIcon(Resource.drawable.ic_menu_refresh); | |
| return true; | |
| } | |
| public override bool OnOptionsItemSelected(IMenuItem item) | |
| { | |
| switch (item.Title.ToS()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Android.Content; | |
| using MonoStockPortfolio.Core.PortfolioRepositories; | |
| using MonoStockPortfolio.Core.Services; | |
| using MonoStockPortfolio.Core.StockData; | |
| using PostSharp.Aspects; | |
| using TinyIoC; | |
| namespace MonoStockPortfolio.Framework | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private IProductRepository _productRepository; | |
| private IProductRepository ProductRepository | |
| { | |
| get | |
| { | |
| if(_productRepository == null) | |
| { | |
| _productRepository = new ProductRepository(); | |
| } | |
| return _productRepository; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private IProductRepository _productRepository; | |
| private IProductRepository ProductRepository | |
| { | |
| get | |
| { | |
| if(_productRepository == null) | |
| { | |
| _productRepository = ObjectFactory.GetInstance<IProductRepository>(); | |
| } | |
| return _productRepository; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [LazyLoad] private IProductRepository _productRepository; | |
| public class LazyLoadAttribute : LocationInterceptionAspect | |
| { | |
| public override void OnGetValue(LocationInterceptionArgs args) | |
| { | |
| if (args.Value == null) | |
| { | |
| var locationType = args.Location.LocationType; | |
| var instantiation = ObjectFactory.GetInstance(locationType); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Serializable] | |
| public sealed class LazyLoadAttribute : LocationInterceptionAspect | |
| { | |
| public override void OnGetValue(LocationInterceptionArgs args) | |
| { | |
| var form = (ProductForm)args.Instance; // this form is only used here to write to a listbox for demonstration | |
| args.ProceedGetValue(); | |
| if (args.Value == null) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [LazyLoad] private IProductRepository _productRepository; | |
| [Serializable] | |
| public sealed class LazyLoadAttribute : LocationInterceptionAspect | |
| { | |
| public override void OnGetValue(LocationInterceptionArgs args) | |
| { | |
| var form = (ProductForm)args.Instance; // this form is only used here to write to a listbox for demonstration | |
| args.ProceedGetValue(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [LazyLoad] private IProductRepository _productRepository; | |
| [Serializable] | |
| public sealed class LazyLoadAttribute : LocationInterceptionAspect | |
| { | |
| public override void OnGetValue(LocationInterceptionArgs args) | |
| { | |
| args.ProceedGetValue(); | |
| if (args.Value == null) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Serializable] | |
| public sealed class LazyLoadAttribute : LocationInterceptionAspect | |
| { | |
| private Type _type; | |
| public override bool CompileTimeValidate(PostSharp.Reflection.LocationInfo locationInfo) | |
| { | |
| // DependencyMap.GetConcreteType will just return the concrete type given an interface | |
| _type = DependencyMap.GetConcreteType(locationInfo.LocationType); | |
| if(_type == null) |