Interface
IFiddlerPreferences

The IFiddlerPreferences Interface is exposed by the FiddlerApplication.Prefs object, and enables callers to Add, Update, and Remove preferences, as well as observe changes to the preferences.

Definition

Namespace:Fiddler

Assembly:FiddlerCore.dll

Syntax:

cs-api-definition
public interface IFiddlerPreferences : IEnumerable<KeyValuePair<string, string>>, IEnumerable

Inherited Members IEnumerable<KeyValuePair<string, string>>.GetEnumerator()IEnumerable.GetEnumerator()

Properties

this[string]

Indexer. Returns the value of the preference as a string

Declaration

cs-api-definition
string this[string sName] { get; set; }

Parameters

sName

string

The Preference Name

Property Value

string

The Preference value as a string, or null

Methods

AddWatcher(string, EventHandler<PrefChangeEventArgs>)

Add a Watcher that will be notified when a value has changed within the specified prefix.

Declaration

cs-api-definition
PreferenceBag.PrefWatcher AddWatcher(string sPrefixFilter, EventHandler<PrefChangeEventArgs> pcehHandler)

Parameters

sPrefixFilter

string

The prefix of preferences for which changes are interesting

pcehHandler

EventHandler<PrefChangeEventArgs>

The Event handler to notify

Returns

PreferenceBag.PrefWatcher

Returns the Watcher object added to the notification list

GetBoolPref(string, bool)

Get a preference's value as a boolean

Declaration

cs-api-definition
bool GetBoolPref(string sPrefName, bool bDefault)

Parameters

sPrefName

string

The Preference Name

bDefault

bool

The default value for missing or invalid preferences

Returns

bool

A Boolean

GetInt32Pref(string, int)

Gets a preference's value as a 32-bit integer

Declaration

cs-api-definition
int GetInt32Pref(string sPrefName, int iDefault)

Parameters

sPrefName

string

The Preference Name

iDefault

int

The default value for missing or invalid preferences

Returns

int

An integer

GetStringPref(string, string)

Gets a preference's value as a string

Declaration

cs-api-definition
string GetStringPref(string sPrefName, string sDefault)

Parameters

sPrefName

string

The Preference Name

sDefault

string

The default value for missing preferences

Returns

string

A string

RemovePref(string)

Removes a named preference from storage

Declaration

cs-api-definition
void RemovePref(string sPrefName)

Parameters

sPrefName

string

The name of the preference to remove

RemoveWatcher(PrefWatcher)

Removes a previously-created preference Watcher from the notification queue

Declaration

cs-api-definition
void RemoveWatcher(PreferenceBag.PrefWatcher wliToRemove)

Parameters

wliToRemove

PreferenceBag.PrefWatcher

The Watcher to remove

SetBoolPref(string, bool)

Store a boolean value for a preference

Declaration

cs-api-definition
void SetBoolPref(string sPrefName, bool bValue)

Parameters

sPrefName

string

The named preference

bValue

bool

The boolean value to store

SetInt32Pref(string, int)

Store an Int32 value for a preference

Declaration

cs-api-definition
void SetInt32Pref(string sPrefName, int iValue)

Parameters

sPrefName

string

The named preference

iValue

int

The int32 value to store

SetPrefs(IEnumerable<KeyValuePair<string, string>>)

Store multiple preferences.

Declaration

cs-api-definition
void SetPrefs(IEnumerable<KeyValuePair<string, string>> prefs)

Parameters

prefs

IEnumerable<KeyValuePair<string, string>>

An enumeration of the preferences' names and values to store.

SetStringPref(string, string)

Store a string value for a preference

Declaration

cs-api-definition
void SetStringPref(string sPrefName, string sValue)

Parameters

sPrefName

string

The named preference

sValue

string

The string value to store