protected async Task <IResourcePickerDialog> InitializeAsync(IEnvironmentViewModel environmentViewModel)
        {
            environmentViewModel.Connect();

            environmentViewModel.LoadDialogAsync("");
            switch (_activityType)
            {
            case enDsfActivityType.Workflow:
            case enDsfActivityType.Service:
                environmentViewModel.Filter(a => a.IsFolder || a.IsService);
                break;

            case enDsfActivityType.Source:
                environmentViewModel.Filter(a => a.IsFolder || a.IsSource);
                break;

            case enDsfActivityType.All:
                break;

            default:
                break;
            }
            environmentViewModel.SelectAction = a => SelectedResource = a;
            return(this);
        }
        protected virtual async void LoadEnvironment(IEnvironmentViewModel localhostEnvironment)
        {
            localhostEnvironment.Connect();
            await localhostEnvironment.Load(true, true);

            AfterLoad(localhostEnvironment.Server.EnvironmentID);
        }
 void LoadLocalHostEnvironment(IEnvironmentViewModel localhostEnvironment)
 {
     if (!localhostEnvironment.IsConnected)
     {
         localhostEnvironment.Connect();
     }
     LoadEnvironment(localhostEnvironment);
 }
        protected virtual async Task <bool> LoadEnvironment(IEnvironmentViewModel localhostEnvironment, bool isDeploy = false)
        {
            IsLoading = true;
            localhostEnvironment.Connect();
            var result = await localhostEnvironment.Load(isDeploy, true);

            AfterLoad(localhostEnvironment.Server.EnvironmentID);
            IsLoading = false;
            return(result);
        }
Esempio n. 5
0
#pragma warning disable 1998
#pragma warning disable 1998
        private async Task <IRequestServiceNameViewModel> InitializeAsync(IEnvironmentViewModel environmentViewModel, string selectedPath, string header, IExplorerItemViewModel explorerItemViewModel = null)
#pragma warning restore 1998
#pragma warning restore 1998
        {
            _environmentViewModel = environmentViewModel;
            _environmentViewModel.Connect();
            _selectedPath          = selectedPath;
            _header                = header;
            _explorerItemViewModel = explorerItemViewModel;
            OkCommand              = new DelegateCommand(SetServiceName, () => string.IsNullOrEmpty(ErrorMessage) && HasLoaded);
            DuplicateCommand       = new DelegateCommand(CallDuplicateService, CanDuplicate);
            CancelCommand          = new DelegateCommand(CloseView, CanClose);
            Name        = header;
            IsDuplicate = explorerItemViewModel != null;

            if (ServerRepository.Instance.ActiveServer == null)
            {
                var shellViewModel = CustomContainer.Get <IShellViewModel>();
                ServerRepository.Instance.ActiveServer = shellViewModel?.ActiveServer;
            }

            return(this);
        }