Switching and charging of a ruthenium dye on Ag(111).