Show / Hide Table of Contents

Class SettingInfo

Encapsulates data for a setting item.

Inheritance
object
SettingInfo
Implements
ISerializable
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Settings
Assembly: Sartorius.SAF.dll
Syntax
[Serializable]
public class SettingInfo : ISerializable

Constructors

View Source

SettingInfo(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.

View Source

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
SerializationInfo info

The SerializationInfo.

StreamingContext context

The StreamingContext.

Properties

View Source

Application

Gets the name of the application.

Declaration
public string Application { get; }
Property Value
Type Description
string
View Source

ContentBinary

Gets or sets the content as binary blob.

Declaration
public byte[] ContentBinary { get; set; }
Property Value
Type Description
byte[]
View Source

CustomSerializationBinder

Gets or sets the custom serialization binder.

Declaration
public SerializationBinder CustomSerializationBinder { get; set; }
Property Value
Type Description
SerializationBinder

The custom serialization binder.

View Source

Scope

Gets the scope of the setting.

Declaration
public SettingScope Scope { get; }
Property Value
Type Description
SettingScope
View Source

SettingId

Gets or sets the id of the setting item.

Declaration
public string SettingId { get; set; }
Property Value
Type Description
string
View Source

User

Gets or sets the user name.

Declaration
public string User { get; set; }
Property Value
Type Description
string

Methods

View Source

GetContent<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 null if the content is not of the specified type.

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).

View Source

GetObjectData(SerializationInfo, StreamingContext)

Populates a SerializationInfo with the data needed to serialize the target object.

Declaration
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
SerializationInfo info

The SerializationInfo to populate with data.

StreamingContext context

The destination (see StreamingContext) for this serialization.

Exceptions
Type Condition
SecurityException

The caller does not have the required permission.

View Source

SetContent(object)

Sets the content of the setting item.

Declaration
public void SetContent(object content)
Parameters
Type Name Description
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>().

Implements

ISerializable

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX