RequestContextSetPreference Method |
Version 71.0.0
Set the value associated with preference name. If value is null the
preference will be restored to its default value. If setting the preference
fails then error will be populated with a detailed description of the
problem. This method must be called on the CEF UI thread.
Preferences set via the command-line usually cannot be modified.
Set the value associated with preference name. If value is null the
preference will be restored to its default value. If setting the preference
fails then error will be populated with a detailed description of the
problem. This method must be called on the CEF UI thread.
Preferences set via the command-line usually cannot be modified.
Namespace:
CefSharp
Assembly:
CefSharp.Core (in CefSharp.Core.dll) Version: 71.0.0.0
Syntax public virtual bool SetPreference(
string name,
Object value,
out string error
)
public:
virtual bool SetPreference(
String^ name,
Object^ value,
[OutAttribute] String^% error
)
Parameters
- name
- Type: SystemString
preference keypreference key - value
- Type: SystemObject
preference valuepreference value - error
- Type: SystemString
out errorout error
Return Value
Type:
BooleanReturns true if the value is set successfully and false otherwise.
Return Value
Type:
BooleanReturns true if the value is set successfully and false otherwise.
Implements
IRequestContextSetPreference(String, Object, String)Remarks Use Cef.UIThreadTaskFactory to execute this method if required,
Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
executed on the CEF UI thread, so can be called directly.
When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
application thread will be the CEF UI thread.
Remarks Use Cef.UIThreadTaskFactory to execute this method if required,
Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
executed on the CEF UI thread, so can be called directly.
When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
application thread will be the CEF UI thread.
See Also