コード例 #1
0
        /// <summary>
        /// Execute upload command
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public static ICommandResult Upload(IEntity entity)
        {
            if (entity.GetType() == typeof(Upload))
            {
                var         uploadData  = (Upload)entity;
                LoginResult loginResult = (LoginResult)uploadData.ID.Id;

                IUploadPresenter presenter = ServiceLocator.GetObject <IUploadPresenter>(ServiceLocator.GetObject <IUploadView>(loginResult.SessionId));
                presenter.Upload(null, uploadData);

                return(presenter);
            }

            throw new ArgumentOutOfRangeException("entity", string.Format("{0} Entity is not supported.", entity.GetType()));
        }
コード例 #2
0
 public UploadController(IUploadPresenter uploadPresenter)
 {
     _uploadPresenter = uploadPresenter;
 }