MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / WriteToFile

Method WriteToFile

dotnet/src/webdriver/Firefox/Preferences.cs:119–129  ·  view source on GitHub ↗

Writes the preferences to a file. The full path to the file to be written.

(string filePath)

Source from the content-addressed store, hash-verified

117 /// </summary>
118 /// <param name="filePath">The full path to the file to be written.</param>
119 internal void WriteToFile(string filePath)
120 {
121 using (TextWriter writer = File.CreateText(filePath))
122 {
123 foreach (KeyValuePair<string, string> preference in this.preferences)
124 {
125 string escapedValue = preference.Value.Replace(@"\", @"\\");
126 writer.WriteLine(string.Format(CultureInfo.InvariantCulture, "user_pref(\"{0}\", {1});", preference.Key, escapedValue));
127 }
128 }
129 }
130
131 private static bool IsWrappedAsString(string value)
132 {

Callers 1

UpdateUserPreferencesMethod · 0.80

Calls 1

FormatMethod · 0.80

Tested by

no test coverage detected