private IFavorite CopyInPersistence() { IFavorite source = this.CreatePrimaryFavorite(); IFavorite copy = source.Copy(); this.PrimaryFavorites.Add(copy); return(source); }
private IFavorite GetFavoriteUpdatedCopy(IFavorite favorite, ConnectionDefinition definition) { IFavorite favoriteCopy = favorite.Copy(); UpdateForceConsole(favoriteCopy, definition); if (definition.ForceNewWindow.HasValue) favoriteCopy.NewWindow = definition.ForceNewWindow.Value; var guarded = this.guardedCredentialFactory.CreateSecurityOptoins(favoriteCopy.Security); guarded.UpdateFromCredential(definition.Credentials); return favoriteCopy; }
private IFavorite CopySelectedFavorite(IFavorite favorite, string newName) { this.source = favorite; IFavorite copy = favorite.Copy(); // expecting the copy it self is valid, let validate only the name copy.Name = newName; bool valid = this.renameCommand.ValidateNewName(favorite, newName); if (!valid) return null; this.renameCommand.ApplyRename(copy, newName); return copy; }
private IFavorite GetFavoriteUpdatedCopy(IFavorite favorite, ConnectionDefinition definition) { // TODO ensure the ID was copied, otherwise the tabControl can never communicate // with rest of the app, because it will never find it by ID. IFavorite favoriteCopy = favorite.Copy(); UpdateForceConsole(favoriteCopy, definition); if (definition.ForceNewWindow.HasValue) { favoriteCopy.NewWindow = definition.ForceNewWindow.Value; } var guarded = this.guardedCredentialFactory.CreateSecurityOptoins(favoriteCopy.Security); guarded.UpdateFromCredential(definition.Credentials); return(favoriteCopy); }
private IFavorite CopySelectedFavorite(IFavorite favorite, string newName) { this.source = favorite; var copy = favorite.Copy(); // expecting the copy it self is valid, let validate only the name copy.Name = newName; var valid = this.renameCommand.ValidateNewName(favorite, newName); if (!valid) { return(null); } this.renameCommand.ApplyRename(copy, newName); return(copy); }