Class SettingsUtil
Provides functionality to serialize and deserialize settings bundles.
Inheritance
Inherited Members
Namespace: Sdl.Core.Settings
Assembly: Sdl.Core.Settings.dll
Syntax
public static class SettingsUtil
Methods
CreateJsonSettingsBundle(ISettingsBundle)
Declaration
public static ISettingsBundle CreateJsonSettingsBundle(ISettingsBundle parent)
Parameters
Type | Name | Description |
---|---|---|
ISettings |
parent |
Returns
Type | Description |
---|---|
ISettings |
CreateSettingsBundle(ISettingsBundle)
Creates a new SettingsBundle
Declaration
public static ISettingsBundle CreateSettingsBundle(ISettingsBundle parent)
Parameters
Type | Name | Description |
---|---|---|
ISettings |
parent | the SettingsBundle parent |
Returns
Type | Description |
---|---|
ISettings |
the created ISettingsBundle |
CreateSettingsBundle(ISettingsBundle, ISettingsBundle)
Creates a new SettingsBundle
Declaration
public static ISettingsBundle CreateSettingsBundle(ISettingsBundle parent, ISettingsBundle source)
Parameters
Type | Name | Description |
---|---|---|
ISettings |
parent | the SettingsBundle parent |
ISettings |
source | the source implementation |
Returns
Type | Description |
---|---|
ISettings |
the created ISettingsBundle |
CreateSettingsBundle(ISettingsBundle, Boolean)
Creates a new SettingsBundle
Declaration
public static ISettingsBundle CreateSettingsBundle(ISettingsBundle parent, bool isDefault)
Parameters
Type | Name | Description |
---|---|---|
ISettings |
parent | the SettingsBundle parent |
System. |
isDefault | whether the created SettingsBundle uses default settings |
Returns
Type | Description |
---|---|
ISettings |
the created ISettingsBundle |
DeserializeJsonSettingsBundle(JObject)
Declaration
public static ISettingsBundle DeserializeJsonSettingsBundle(JObject settingBundleJObject)
Parameters
Type | Name | Description |
---|---|---|
Newtonsoft. |
settingBundleJObject |
Returns
Type | Description |
---|---|
ISettings |
DeserializeJsonSettingsBundle(String)
Declaration
public static ISettingsBundle DeserializeJsonSettingsBundle(string jsonSettingsBundle)
Parameters
Type | Name | Description |
---|---|---|
System. |
jsonSettingsBundle |
Returns
Type | Description |
---|---|
ISettings |
DeserializeSettingsBundle(XmlReader, ISettingsBundle)
Deserialize the content pointed to in the specified XmlReader to a SettingsBundle object and give it access to the hierarchy information through the specified provider
Declaration
public static ISettingsBundle DeserializeSettingsBundle(XmlReader reader, ISettingsBundle parent)
Parameters
Type | Name | Description |
---|---|---|
System. |
reader | The XML reader, pointing to a valid opening SettingsBundle tag |
ISettings |
parent | The hierarchy provider |
Returns
Type | Description |
---|---|
ISettings |
the desiralized ISettingsBundle |
DeserializeSettingsBundle(XmlReader, ISettingsBundle, Boolean)
Deserialize the content pointed to in the specified XmlReader to a SettingsBundle object and give it access to the hierarchy information through the specified provider
Declaration
public static ISettingsBundle DeserializeSettingsBundle(XmlReader reader, ISettingsBundle parent, bool isDefault)
Parameters
Type | Name | Description |
---|---|---|
System. |
reader | The XML reader, pointing to a valid opening SettingsBundle tag |
ISettings |
parent | The hierarchy provider |
System. |
isDefault | Whether the deserialized settings bundle defines default settings |
Returns
Type | Description |
---|---|
ISettings |
the desiralized ISettingsBundle |
SerializeJsonSettingsBundle(ISettingsBundle)
Declaration
public static string SerializeJsonSettingsBundle(ISettingsBundle jsonSettingsBundle)
Parameters
Type | Name | Description |
---|---|---|
ISettings |
jsonSettingsBundle |
Returns
Type | Description |
---|---|
System. |
SerializeJsonSettingsBundleToJObject(ISettingsBundle)
Declaration
public static JObject SerializeJsonSettingsBundleToJObject(ISettingsBundle jsonSettingsBundle)
Parameters
Type | Name | Description |
---|---|---|
ISettings |
jsonSettingsBundle |
Returns
Type | Description |
---|---|
Newtonsoft. |
SerializeSettingsBundle(XmlWriter, ISettingsBundle)
Serialize the given SettingsBundle using the specified XmlWriter
Declaration
public static void SerializeSettingsBundle(XmlWriter writer, ISettingsBundle iSettingsBundle)
Parameters
Type | Name | Description |
---|---|---|
System. |
writer | The XML writer to use |
ISettings |
iSettingsBundle | The ISettingsBundle to serialize |
SerializeSettingsBundle(XmlWriter, ISettingsBundle, Boolean)
Serialize the given SettingsBundle using the specified XmlWriter
Declaration
public static void SerializeSettingsBundle(XmlWriter writer, ISettingsBundle iSettingsBundle, bool includeInheritedSettings)
Parameters
Type | Name | Description |
---|---|---|
System. |
writer | The XML writer to use |
ISettings |
iSettingsBundle | The ISettingsBundle to serialize |
System. |
includeInheritedSettings | Whether to include inherited settings |