コード例 #1
0
        public override void LoadDataAsync(LoadCommand cmd, LoadDataAsyncParameters cmdParam, Action <PaneViewModelBase> success = null, Action <PaneViewModelBase, Exception> error = null)
        {
            base.LoadDataAsync(cmd, cmdParam, success, error);
            switch (cmd)
            {
            case LoadCommand.Load:
                using (var db = _dbContext.Open())
                {
                    Items.AddRange(db.Get <FtpConnection>().Select(c => new FtpConnectionItemViewModel(c)));
                }
                var add = new NewConnectionPlaceholderViewModel();
                Items.Add(add);
                break;

            case LoadCommand.Restore:
                Save(cmdParam.Payload as FtpConnectionItemViewModel);
                ConnectedFtp = null;
                break;
            }
            if (success != null)
            {
                success.Invoke(this);
            }
        }
コード例 #2
0
 public override void LoadDataAsync(LoadCommand cmd, LoadDataAsyncParameters cmdParam, Action<PaneViewModelBase> success = null, Action<PaneViewModelBase, Exception> error = null)
 {
     base.LoadDataAsync(cmd, cmdParam, success, error);
     switch (cmd)
     {
         case LoadCommand.Load:
             using (var db = _dbContext.Open())
             {
                 Items.AddRange(db.Get<FtpConnection>().Select(c => new FtpConnectionItemViewModel(c)));
             }
             var add = new NewConnectionPlaceholderViewModel();
             Items.Add(add);
             break;
         case LoadCommand.Restore:
             Save(cmdParam.Payload as FtpConnectionItemViewModel);
             ConnectedFtp = null;
             break;
     }
     if (success != null) success.Invoke(this);
 }