public void DeleteVersionCommand(IExplorerRepository explorerRepository, ExplorerItemViewModel explorerItemViewModel, IExplorerTreeItem parent, string resourceName) { if (_popupController.ShowDeleteVersionMessage(resourceName) == MessageBoxResult.Yes) { explorerRepository.TryDelete(explorerItemViewModel); var parentChildren = new ObservableCollection <IExplorerItemViewModel>(parent.Children); var index = 0; for (var i = 0; i < parentChildren.Count; i++) { if (parentChildren[i].ResourceName == resourceName) { index = i; break; } } parentChildren.RemoveAt(index); parent.Children = new ObservableCollection <IExplorerItemViewModel>(parentChildren); if (parent.ChildrenCount == 0) { parent.AreVersionsVisible = true; } if (parentChildren.Count == 0) { parent.AreVersionsVisible = false; parent.IsMergeVisible = false; } _shellViewModel.UpdateExplorerWorkflowChanges(explorerItemViewModel.ResourceId); } }
public void DeleteCommand(IExplorerTreeItem parent, IExplorerRepository explorerRepository, ExplorerItemViewModel explorerItemViewModel, IPopupController popupController, IServer server) { try { if (explorerItemViewModel.IsResourceVersion) { DeleteVersionCommand(explorerRepository, explorerItemViewModel, parent, explorerItemViewModel.ResourceName); } else { var messageBoxResult = popupController.Show(popupController.GetDeleteConfirmation(explorerItemViewModel.ResourceName)); if (server != null && messageBoxResult == MessageBoxResult.Yes) { _shellViewModel.CloseResource(explorerItemViewModel.ResourceId, server.EnvironmentID); var deletedFileMetadata = explorerRepository.Delete(explorerItemViewModel); if (deletedFileMetadata.IsDeleted) { if (explorerItemViewModel.ResourceType == @"ServerSource" || explorerItemViewModel.IsServer) { server.UpdateRepository.FireServerSaved(explorerItemViewModel.ResourceId, true); } parent?.RemoveChild(explorerItemViewModel); } } } } catch (Exception ex) { explorerItemViewModel.ShowErrorMessage(ex.Message, @"Delete not allowed"); } }
public TeamOfExplorersService(ITeamOfExplorersRepository repository, ITeamOfExplorersValidator teamOfExplorersValidator, IShuttleRepository shuttleRepository, IExplorerRepository explorerRepository) { _repository = repository; _teamOfExplorersValidator = teamOfExplorersValidator; _shuttleRepository = shuttleRepository; _explorerRepository = explorerRepository; }
public HumanCaptainService(IHumanCaptainRepository repository, IHumanCaptainValidator humanCaptainValidator, ITeamOfExplorersRepository teamOfExplorersRepository, IShuttleRepository shuttleRepository, IExplorerRepository explorerRepository) { _repository = repository; _humanCaptainValidator = humanCaptainValidator; _teamOfExplorersRepository = teamOfExplorersRepository; _shuttleRepository = shuttleRepository; _explorerRepository = explorerRepository; }
public ApiDatabaseCachingProcessor( ICurrencyProvider iCurrencyProvider, IExplorerRepository iCurrencyRepository, ICollection <DayOfWeek> weekends) : this(iCurrencyProvider, iCurrencyRepository) { // Override weekends. _weekends = weekends; }
public RobotService(IRobotRepository repository, IRobotValidator robotValidator, ITeamOfExplorersRepository teamOfExplorersRepository, IShuttleRepository shuttleRepository, IExplorerRepository explorerRepository, IHttpClientFactory clientFactory) { _repository = repository; _robotValidator = robotValidator; _teamOfExplorersRepository = teamOfExplorersRepository; _shuttleRepository = shuttleRepository; _explorerRepository = explorerRepository; _clientFactory = clientFactory; }
void DeleteIfAllowed(IExplorerTreeItem parent, IExplorerRepository explorerRepository, ExplorerItemViewModel explorerItemViewModel, IPopupController popupController, IServer server) { if (explorerItemViewModel.IsResourceVersion) { DeleteVersionCommand(explorerRepository, explorerItemViewModel, parent, explorerItemViewModel.ResourceName); } else { DeleteCommand(parent, explorerRepository, explorerItemViewModel, popupController, server); } }
public void TryDeleteCommand(IExplorerTreeItem parent, IExplorerRepository explorerRepository, ExplorerItemViewModel explorerItemViewModel, IPopupController popupController, IServer server) { try { DeleteIfAllowed(parent, explorerRepository, explorerItemViewModel, popupController, server); } catch (Exception ex) { explorerItemViewModel.ShowErrorMessage(ex.Message, @"Delete not allowed"); } }
public void RollbackCommand(IExplorerRepository explorerRepository, IExplorerTreeItem parent, Guid resourceId, string versionNumber) { var output = explorerRepository.Rollback(resourceId, versionNumber); parent.AreVersionsVisible = true; parent.ResourceName = output.DisplayName; if (parent.Server != null) { _shellViewModel.CloseResource(resourceId, parent.Server.EnvironmentID); _shellViewModel.OpenCurrentVersion(resourceId, parent.Server.EnvironmentID); } }
void Initialize(Guid id, IEnvironmentConnection environmentConnection, IResourceRepository resourceRepository) { VerifyArgument.IsNotNull("environmentConnection", environmentConnection); CanStudioExecute = true; EnvironmentID = id; Connection = environmentConnection; ResourceRepository = resourceRepository ?? new ResourceRepository(this); var communicationControllerFactory = new CommunicationControllerFactory(); _proxyLayer = new StudioServerProxy(communicationControllerFactory, Connection); UpdateRepository = new StudioResourceUpdateManager(communicationControllerFactory, Connection); Connection.PermissionsModified += RaisePermissionsModifiedEvent; Connection.NetworkStateChanged += RaiseNetworkStateChangeEvent; Connection.ItemAddedMessageAction += ItemAdded; }
public ApiDatabaseCachingProcessor( ICurrencyProvider iCurrencyProvider, IExplorerRepository iCurrencyRepository) { _currencyProvider = iCurrencyProvider; _currencyRepository = iCurrencyRepository; _weekends = new List <DayOfWeek>() { DayOfWeek.Sunday, DayOfWeek.Saturday }; Data = null; var allCodes = RequestAllCurrencyCodes(); //CurrencyRepository.AddCodeEntries(allCodes); }
void DeleteCommand(IExplorerTreeItem parent, IExplorerRepository explorerRepository, ExplorerItemViewModel explorerItemViewModel, IPopupController popupController, IServer server) { var messageBoxResult = popupController.Show(popupController.GetDeleteConfirmation(explorerItemViewModel.ResourceName)); if (server != null && messageBoxResult == MessageBoxResult.Yes) { _shellViewModel.CloseResource(explorerItemViewModel.ResourceId, server.EnvironmentID); var deletedFileMetadata = explorerRepository.TryDelete(explorerItemViewModel); if (deletedFileMetadata.IsDeleted) { if (explorerItemViewModel.ResourceType == @"ServerSource" || explorerItemViewModel.IsServer) { server.UpdateRepository.FireServerSaved(explorerItemViewModel.ResourceId, true); } parent?.RemoveChild(explorerItemViewModel); } } }
public void DeleteVersionCommand(IExplorerRepository explorerRepository, ExplorerItemViewModel explorerItemViewModel, IExplorerTreeItem parent, string resourceName) { if (_popupController.ShowDeleteVersionMessage(resourceName) == MessageBoxResult.Yes) { explorerRepository.Delete(explorerItemViewModel); var parentChildren = new ObservableCollection <IExplorerItemViewModel>(parent.Children); var index = 0; for (var i = 0; i < parentChildren.Count; i++) { if (parentChildren[i].ResourceName == resourceName) { index = i; break; } } parentChildren.RemoveAt(index); parent.Children = new ObservableCollection <IExplorerItemViewModel>(parentChildren); } }
public CurrencyXplorer(IApplicationEnvironment appEnv) : this() { //Configuration = Utils.CreateConfiguration(appEnv, "config.json"); // Entry point for dependency injection. _iCurrencyImporter = new JsonCurrencyImporter(); //_iCurrencyImporter = new LocalJsonCurrencyImporter(); ; _iCurrencyProvider = new NationalBankCurrencyProvider(_iCurrencyImporter); _currencyDataContext = new CurrencyDataContext(Configuration["Data:DefaultConnection:ConnectionString"]); _iCurrencyRepository = new MsSqlExplorerRepository(_currencyDataContext); _iCachingProcessor = new ApiDatabaseCachingProcessor(_iCurrencyProvider, _iCurrencyRepository); _iUserSettingsHolder = new UserSettingsHolder(_iCurrencyRepository); _dataPresenter = new DataPresenter(); //_dataHolder = new DataHolder(_iCachingProcessor, _iUserSettingsHolder, Configuration); _dataProcessor = new DataProcessor(_iCachingProcessor); _allCurrencyCodes = GetAllCurrencyCodes(); }
public ExplorerDeleteProvider(IExplorerRepository repository) { _repository = repository; }
public UserSettingsHolder(IExplorerRepository _explorerRepository) { ExplorerRepository = _explorerRepository; }
public LocationController(IExplorerRepository repo) { _repo = repo; }