private void Convert() { string value = inputTextbox.Text; string unitFrom = UnitFromCombobox.Text; string unitTo = UnitToCombobox.Text; string result = ((IConverter)convertersCombobox.SelectedItem).Convert(RemoveWhiteSpace(value), unitFrom, unitTo); LogDB.AddToDB(((IConverter)convertersCombobox.SelectedItem).Name.ToString(), unitFrom, unitTo, RemoveWhiteSpace(value), result); resultTextbox.Text = result; if (((IConverter)convertersCombobox.SelectedItem).Name == "Format Czasu") { SetClock(result, unitFrom); } }