Example #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var assemblies = new Assembly[] {
                Assembly.Load("CooperDemo.Model"),
                Assembly.Load("CooperDemo.Repositories"),
                Assembly.Load("CooperDemo")
            };

            Configuration.Config()
            .SetResolver(new TinyIoCDependencyResolver())
            .RegisterDefaultComponents(assemblies);

            _logger            = DependencyResolver.Resolve <ILoggerFactory>().Create(typeof(MainActivity));
            _taskFolderService = DependencyResolver.Resolve <ITaskFolderService>();

            SetContentView(Resource.Layout.Main);

            _listView = FindViewById <ListView>(Resource.Id.list);
            _listView.SetOnCreateContextMenuListener(this);

            Button button1 = FindViewById <Button>(Resource.Id.GetAllTaskFoldersButton);

            button1.Click += (sender, e) =>
            {
                SendGetAllTaskFoldersRequest();
            };

            SendLoginRequest();

            _logger.InfoFormat("Application '{0}' Started.", "Cooper");
        }
Example #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var assemblies = new Assembly[] {
                Assembly.Load("CooperDemo.Model"),
                Assembly.Load("CooperDemo.Repositories"),
                Assembly.Load("CooperDemo")
            };

            Configuration.Config()
                .SetResolver(new TinyIoCDependencyResolver())
                .RegisterDefaultComponents(assemblies);

            _logger = DependencyResolver.Resolve<ILoggerFactory>().Create(typeof(MainActivity));
            _taskFolderService = DependencyResolver.Resolve<ITaskFolderService>();

            SetContentView(Resource.Layout.Main);

            _listView = FindViewById<ListView>(Resource.Id.list);
            _listView.SetOnCreateContextMenuListener(this);

            Button button1 = FindViewById<Button>(Resource.Id.GetAllTaskFoldersButton);
            button1.Click += (sender, e) =>
            {
                SendGetAllTaskFoldersRequest();
            };

            SendLoginRequest();

            _logger.InfoFormat("Application '{0}' Started.", "Cooper");
        }
Example #3
0
 public TaskFolderController(
     ITaskFolderService taskFolderService,
     ITaskVaultService taskVaultService
     )
 {
     _taskFolderService = taskFolderService;
     _taskVaultService  = taskVaultService;
 }
Example #4
0
 public TaskController(ILoggerFactory factory
                       , IAccountService accountService
                       , ITaskService taskService
                       , ITaskFolderService taskFolderService
                       , IFetchTaskHelper fetchTaskHelper)
     : base(factory)
 {
     this._log               = factory.Create(this.GetType());
     this._accountService    = accountService;
     this._taskService       = taskService;
     this._taskFolderService = taskFolderService;
     this._fetchTaskHelper   = fetchTaskHelper;
 }
Example #5
0
 public PersonalController(ILoggerFactory factory
                           , ITaskService taskService
                           , IPersonalTaskService personalTaskService
                           , ITaskFolderService taskFolderService
                           , IFetchTaskHelper fetchTaskHelper
                           , IAccountService accountService
                           , IAccountConnectionService accountConnectionService)
     : base(factory
            , accountService
            , taskService
            , taskFolderService
            , fetchTaskHelper)
 {
     this._personalTaskService      = personalTaskService;
     this._accountConnectionService = accountConnectionService;
 }
Example #6
0
 public PersonalController(ILoggerFactory factory
     , ITaskService taskService
     , IPersonalTaskService personalTaskService
     , ITaskFolderService taskFolderService
     , IFetchTaskHelper fetchTaskHelper
     , IAccountService accountService
     , IAccountConnectionService accountConnectionService)
     : base(factory
     , accountService
     , taskService
     , taskFolderService
     , fetchTaskHelper)
 {
     this._personalTaskService = personalTaskService;
     this._accountConnectionService = accountConnectionService;
 }
Example #7
0
 public TeamController(ILoggerFactory factory
                       , IAccountService accountService
                       , IAccountConnectionService accountConnectionService
                       , ITaskService taskService
                       , ITaskFolderService taskFolderService
                       , IFetchTaskHelper fetchTaskHelper
                       , Teams.ITeamService teamService
                       , Teams.ITaskService teamTaskService)
     : base(factory
            , accountService
            , taskService
            , taskFolderService
            , fetchTaskHelper)
 {
     this._accountConnectionService = accountConnectionService;
     this._teamService     = teamService;
     this._teamTaskService = teamTaskService;
 }
Example #8
0
        public void TestFixtureSetUp()
        {
            try
            {
                CodeSharp.Core.Configuration.ConfigWithEmbeddedXml(null
                                                                   , "application_config"
                                                                   , Assembly.GetExecutingAssembly()
                                                                   , "Cooper.Model.Test.ConfigFiles")
                .RenderProperties()
                .Castle(o => this.Resolve(o.Container));

                //初始化同步锁
                DependencyResolver.Resolve <ILockHelper>().Init <Account>();
                DependencyResolver.Resolve <ILockHelper>().Init <GoogleConnection>();
                DependencyResolver.Resolve <ILockHelper>().Init <GitHubConnection>();
                DependencyResolver.Resolve <ILockHelper>().Init <Member>();
            }
            catch (Exception e)
            {
                if (!e.Message.Contains("不可重复初始化配置"))
                {
                    Console.WriteLine(e.Message);
                    throw e;
                }
            }

            this._log            = DependencyResolver.Resolve <ILoggerFactory>().Create(this.GetType());
            this._sessionManager = DependencyResolver.Resolve <Castle.Facilities.NHibernateIntegration.ISessionManager>();

            this._accountHelper            = DependencyResolver.Resolve <IAccountHelper>();
            this._accountService           = DependencyResolver.Resolve <IAccountService>();
            this._accountConnectionService = DependencyResolver.Resolve <IAccountConnectionService>();
            this._taskService         = DependencyResolver.Resolve <Cooper.Model.Tasks.ITaskService>();
            this._taskFolderService   = DependencyResolver.Resolve <ITaskFolderService>();
            this._addressBookService  = DependencyResolver.Resolve <IAddressBookService>();
            this._contactGroupService = DependencyResolver.Resolve <IContactGroupService>();
            this._contactService      = DependencyResolver.Resolve <IContactService>();
            this._teamService         = DependencyResolver.Resolve <ITeamService>();
            this._personalTaskService = DependencyResolver.Resolve <Cooper.Model.Tasks.IPersonalTaskService>();
            this._teamTaskService     = DependencyResolver.Resolve <Cooper.Model.Teams.ITaskService>();
        }
Example #9
0
        public TeamController(ILoggerFactory factory
            , IAccountService accountService
            , IAccountConnectionService accountConnectionService
            , ITaskService taskService
            , ITaskFolderService taskFolderService
            , IFetchTaskHelper fetchTaskHelper
            , Teams.ITeamService teamService
            , Teams.ITaskService teamTaskService

            , UserHelper userHelper)
            : base(factory
            , accountService
            , accountConnectionService
            , taskService
            , taskFolderService
            , fetchTaskHelper
            , teamService
            , teamTaskService)
        {
            this._userHelper = userHelper;
        }
Example #10
0
        public void TestFixtureSetUp()
        {
            try
            {
                CodeSharp.Core.Configuration.ConfigWithEmbeddedXml(null
                    , "application_config"
                    , Assembly.GetExecutingAssembly()
                    , "Cooper.Model.Test.ConfigFiles")
                    .RenderProperties()
                    .Castle(o => this.Resolve(o.Container));

                //初始化同步锁
                DependencyResolver.Resolve<ILockHelper>().Init<Account>();
                DependencyResolver.Resolve<ILockHelper>().Init<GoogleConnection>();
                DependencyResolver.Resolve<ILockHelper>().Init<GitHubConnection>();
                DependencyResolver.Resolve<ILockHelper>().Init<Member>();
            }
            catch (Exception e)
            {
                if (!e.Message.Contains("不可重复初始化配置")){
                    Console.WriteLine(e.Message);
                    throw e;
                }
            }

            this._log = DependencyResolver.Resolve<ILoggerFactory>().Create(this.GetType());
            this._sessionManager = DependencyResolver.Resolve<Castle.Facilities.NHibernateIntegration.ISessionManager>();

            this._accountHelper = DependencyResolver.Resolve<IAccountHelper>();
            this._accountService = DependencyResolver.Resolve<IAccountService>();
            this._accountConnectionService = DependencyResolver.Resolve<IAccountConnectionService>();
            this._taskService = DependencyResolver.Resolve<Cooper.Model.Tasks.ITaskService>();
            this._taskFolderService = DependencyResolver.Resolve<ITaskFolderService>();
            this._addressBookService = DependencyResolver.Resolve<IAddressBookService>();
            this._contactGroupService = DependencyResolver.Resolve<IContactGroupService>();
            this._contactService = DependencyResolver.Resolve<IContactService>();
            this._teamService = DependencyResolver.Resolve<ITeamService>();
            this._personalTaskService = DependencyResolver.Resolve<Cooper.Model.Tasks.IPersonalTaskService>();
            this._teamTaskService = DependencyResolver.Resolve<Cooper.Model.Teams.ITaskService>();
        }
Example #11
0
 public TaskController(ILoggerFactory factory
     , IAccountService accountService
     , ITaskService taskService
     , ITaskFolderService taskFolderService
     , IFetchTaskHelper fetchTaskHelper)
     : base(factory)
 {
     this._log = factory.Create(this.GetType());
     this._accountService = accountService;
     this._taskService = taskService;
     this._taskFolderService = taskFolderService;
     this._fetchTaskHelper = fetchTaskHelper;
 }