Class SettingInfo
Encapsulates data for a setting item.
Inheritance
Implements
Namespace: Sartorius.SAF.Settings
Assembly: Sartorius.SAF.dll
Syntax
[Serializable]
public class SettingInfo : ISerializable
Constructors
View SourceSettingInfo(SettingScope)
Creates a new instance of the SettingInfo class for the specified SettingScope.
Declaration
public SettingInfo(SettingScope scope)
Parameters
Type | Name | Description |
---|---|---|
SettingScope | scope | The SettingScope. |
SettingInfo(SerializationInfo, StreamingContext)
Creates a new instance of the SettingInfo class from the specified serialization info.
Declaration
protected SettingInfo(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | The System.Runtime.Serialization.SerializationInfo. |
System.Runtime.Serialization.StreamingContext | context | The System.Runtime.Serialization.StreamingContext. |
Properties
View SourceApplication
Gets the name of the application.
Declaration
public string Application { get; }
Property Value
Type | Description |
---|---|
System.String |
ContentBinary
Gets or sets the content as binary blob.
Declaration
public byte[] ContentBinary { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
CustomSerializationBinder
Gets or sets the custom serialization binder.
Declaration
public SerializationBinder CustomSerializationBinder { get; set; }
Property Value
Type | Description |
---|---|
System.Runtime.Serialization.SerializationBinder | The custom serialization binder. |
Scope
Gets the scope of the setting.
Declaration
public SettingScope Scope { get; }
Property Value
Type | Description |
---|---|
SettingScope |
SettingID
Gets or sets the id of the setting item.
Declaration
public string SettingID { get; set; }
Property Value
Type | Description |
---|---|
System.String |
User
Gets or sets the user name.
Declaration
public string User { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
View SourceGetContent<T>()
Gets the content as the specified type.
Declaration
public T GetContent<T>()
where T : class
Returns
Type | Description |
---|---|
T | The settings content as the specified type or |
Type Parameters
Name | Description |
---|---|
T | The type of the content. |
Remarks
This method does not throw a deserialization exception if the content cannot be deserialized (e.g due to a version mismatch). This is required for app settings compatibility . In some cases the new version of an application doesn't support the types that were used in a previous version or the type was changed and is no longer binary compatible for deserialization. (e.g extended with new members).
GetObjectData(SerializationInfo, StreamingContext)
Declaration
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | |
System.Runtime.Serialization.StreamingContext | context |
SetContent(Object)
Sets the content of the setting item.
Declaration
public void SetContent(object content)
Parameters
Type | Name | Description |
---|---|---|
System.Object | content | The content of the setting. |
Remarks
In case of a serialization exception for content of type of Dictionary(string,object) try to remove the items that cannot be serialized. See also the remarks for GetContent<T>().