OpenTAP 9.27
API Reference
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Events | List of all members
OpenTap.ComponentSettingsList< DerivedType, ContainedType > Class Template Reference

Contains some extra functionality for the ComponentSettingsList. Created so that it is possible to know which (generic) ComponentSettingsList contains a given type. More...

Inheritance diagram for OpenTap.ComponentSettingsList< DerivedType, ContainedType >:
OpenTap.ComponentSettings< DerivedType > OpenTap.ValidatingObject OpenTap.IComponentSettings OpenTap.IValidatingObject OpenTap.ITapPlugin

Public Member Functions

GetDefault< T > ()
 Gets the first or default instance in the component settings list. More...
 
 ComponentSettingsList ()
 Initializes the list.
 
void Add (ContainedType item)
 Adds an element to the collection. More...
 
void Clear ()
 Removes all elements from the collection.
 
bool Contains (ContainedType item)
 Determines if the collection contains the specified element. More...
 
void CopyTo (ContainedType[] array, int arrayIndex)
 Copies the collection to a compatible array. More...
 
bool Remove (ContainedType item)
 Removes the first occurrence of a specified element from the collection. More...
 
IEnumerator< ContainedType > GetEnumerator ()
 Returns an IEnumerator that iterates through the collection. More...
 
int IndexOf (ContainedType item)
 Returns the index of the first occurrences of a specified element in the collection. More...
 
void Insert (int index, ContainedType item)
 Insert an element into the collection at the specified index. More...
 
void RemoveAt (int index)
 Removes an element at a specified index. More...
 
int Add (object value)
 Adds an element to the collection. More...
 
bool Contains (object value)
 Determines if the collection contains the specified element. More...
 
int IndexOf (object value)
 Returns the index of the first occurrences of a specified element in the collection. More...
 
void Insert (int index, object value)
 Insert an element into the collection at the specified index. More...
 
void Remove (object value)
 Removes the first occurrence of a specified element from the collection. More...
 
void CopyTo (Array array, int index)
 Copies the collection to a compatible array. More...
 
- Public Member Functions inherited from OpenTap.ComponentSettings< DerivedType >
void Save ()
 Saves the settings held by this class to an XML file in the ComponentSettings.SetSettingsProfile(string, string).
 
void Invalidate ()
 Invalidates the cache of this type of component setting.
 
void Reload ()
 Forces the reload of this type of component setting from the XML file the next time the setting is used.
 
virtual void Initialize ()
 Called if a new ComponentSettings is instantiated and there are no corresponding settings XML.
 
- Public Member Functions inherited from OpenTap.ValidatingObject
void OnPropertyChanged (string propertyName)
 Triggers the PropertyChanged event. More...
 

Static Public Member Functions

static IList GetContainer (Type T)
 Finds a ComponentSettingsList containing instances of T. More...
 
static IList< T > GetItems< T > ()
 Gets the ComponentSettings list for T and filters the instances that are not T. More...
 
static IList GetItems (Type T)
 (non-generic) Gets the ComponentSettings list for T and filters the instances that are not T. More...
 
static T GetDefaultOf< T > ()
 Static Get first or default instance in the component settings list. (uses GetCurrent) More...
 
- Static Public Member Functions inherited from OpenTap.ComponentSettings< DerivedType >
static ComponentSettings GetCurrent (Type settingsType)
 Gets current settings for a specified component. This is either an instance of the settings class previously loaded, or a new instance loaded from the associated file. More...
 
static ComponentSettings GetCurrent (ITypeData settingsType)
 Gets current settings for a specified component. This is either an instance of the settings class previously loaded, or a new instance loaded from the associated file. More...
 
static string GetSettingsDirectory (string groupName, bool isProfile=true)
 The directory where the settings are loaded from / saved to. More...
 
static void EnsureSettingsDirectoryExists (string groupName, bool isProfile=true)
 Ensures that the Settings directory exists and that the specified groupName sub directory exists. This might throw an exception if the settings directory was configured to something invalid. Like 'AUX', 'NUL', .... More...
 
static void SetSettingsProfile (string groupName, string profileName)
 Sets the directory in which settings groups are loaded from / saved to. More...
 
static void SaveAllCurrentSettings ()
 Saves all ComponentSettings objects that have been loaded.
 
static string GetSaveFilePath (Type type)
 Gets the current file location where a ComponentSettings type is saved. More...
 
static void SetCurrent (Stream xmlFileStream)
 Sets current settings for a component setting based on a stream of the file contents of a ComponentSettings XML file. More...
 
static void SetCurrent (Stream xmlFileStream, out IEnumerable< XmlError > errors)
 Sets current settings for a component setting based on a stream of the file contents of a ComponentSettings XML file. More...
 
static ComponentSettings GetCurrentFromCache (Type settingsType)
 Gets current settings for a specified component from cache. More...
 

Protected Member Functions

virtual void OnCollectionChanged (object sender, NotifyCollectionChangedEventArgs e)
 This gets invoked when the collection is changed.
 
- Protected Member Functions inherited from OpenTap.ValidatingObject
virtual string GetError (string propertyName=null)
 Return the error for a given property
 
void ThrowOnValidationError (bool ignoreDisabledProperties)
 Checks all validation rules on this object (Rules) and throws an AggregateException on errors. More...
 

Properties

int Count [get]
 Gets the number of elements in the collection.
 
bool IsReadOnly [get]
 Determines if the collection is read only.
 
ContainedType this[int index] [getset]
 List interface More...
 
bool IsFixedSize [get]
 Determines if the collection is fixed size.
 
bool IsSynchronized [get]
 Determines if the collection is synchronized.
 
object SyncRoot [get]
 Gets an object that can be used to synchronize access the collection.
 
- Properties inherited from OpenTap.ComponentSettings< DerivedType >
static T Current [get]
 Get the currently loaded ComponentSettings instance for this class.
 
string? GroupName [get]
 Settings group of this settings class.
 
static string SettingsDirectoryRoot [getset]
 Where settings files are located. Usually this is at "[Executable location]\Settings", but it can be set to different locations. Setting this will invalidate loaded settings.
 
- Properties inherited from OpenTap.ValidatingObject
ValidationRuleCollection Rules [get]
 All the validation rules. Add new rules to this in order to get runtime value validation.
 
string Error [get]
 Gets the error messages for each invalid rule and joins them with a newline.
 
- Properties inherited from OpenTap.IValidatingObject
ValidationRuleCollection Rules [get]
 A collection of all the currently defined validation rules. Add new rules here in order to get runtime value validation.
 

Events

NotifyCollectionChangedEventHandler CollectionChanged
 Invoked when collection is changed.
 
- Events inherited from OpenTap.ComponentSettings< DerivedType >
EventHandler CacheInvalidated
 Invokes when the cache for this settings item is invalidated for this item. The way to handle it is usually to fetch the new instance using ComponentSettings.GetCurrent(sender.GetType()).
 
- Events inherited from OpenTap.ValidatingObject
PropertyChangedEventHandler PropertyChanged
 Standard PropertyChanged event object.
 

Additional Inherited Members

- Static Public Attributes inherited from OpenTap.ComponentSettings< DerivedType >
static bool PersistSettingGroups
 Gets or sets if settings groups should be persisted between processes.
 

Detailed Description

Contains some extra functionality for the ComponentSettingsList. Created so that it is possible to know which (generic) ComponentSettingsList contains a given type.

ComponentSettingsList is a collection of objects. This is the case for DutSettings, for instance. Uses IObservableCollection so that changes can be monitored.

Template Parameters
DerivedType
ContainedType
Type Constraints
DerivedType :ComponentSettingsList 
DerivedType :DerivedType 
DerivedType :ContainedType 

Member Function Documentation

◆ Add() [1/2]

void OpenTap.ComponentSettingsList< DerivedType, ContainedType >.Add ( ContainedType  item)
inline

Adds an element to the collection.

Parameters
item

◆ Add() [2/2]

int OpenTap.ComponentSettingsList< DerivedType, ContainedType >.Add ( object  value)
inline

Adds an element to the collection.

Parameters
value
Returns

◆ Contains() [1/2]

bool OpenTap.ComponentSettingsList< DerivedType, ContainedType >.Contains ( ContainedType  item)
inline

Determines if the collection contains the specified element.

Parameters
item
Returns

◆ Contains() [2/2]

bool OpenTap.ComponentSettingsList< DerivedType, ContainedType >.Contains ( object  value)
inline

Determines if the collection contains the specified element.

Parameters
value
Returns

◆ CopyTo() [1/2]

void OpenTap.ComponentSettingsList< DerivedType, ContainedType >.CopyTo ( Array  array,
int  index 
)
inline

Copies the collection to a compatible array.

Parameters
array
index

◆ CopyTo() [2/2]

void OpenTap.ComponentSettingsList< DerivedType, ContainedType >.CopyTo ( ContainedType[]  array,
int  arrayIndex 
)
inline

Copies the collection to a compatible array.

Parameters
array
arrayIndex

◆ GetContainer()

static IList OpenTap.ComponentSettingsList< DerivedType, ContainedType >.GetContainer ( Type  T)
inlinestatic

Finds a ComponentSettingsList containing instances of T.

Parameters
T
Returns
A List of type T. Null if no ComponentSettingsList exists containing T.

◆ GetDefault&lt; T &gt;()

T OpenTap.ComponentSettingsList< DerivedType, ContainedType >.GetDefault< T > ( )
inline

Gets the first or default instance in the component settings list.

Template Parameters
T
Returns
Type Constraints
T :ContainedType 

◆ GetDefaultOf&lt; T &gt;()

static T OpenTap.ComponentSettingsList< DerivedType, ContainedType >.GetDefaultOf< T > ( )
static

Static Get first or default instance in the component settings list. (uses GetCurrent)

Template Parameters
T
Returns
Type Constraints
T :ContainedType 
T :GetCurrent<DerivedType>() 
T :OfType<T>() 
T :FirstOrDefault() 

◆ GetEnumerator()

IEnumerator< ContainedType > OpenTap.ComponentSettingsList< DerivedType, ContainedType >.GetEnumerator ( )
inline

Returns an IEnumerator that iterates through the collection.

Returns

◆ GetItems()

static IList OpenTap.ComponentSettingsList< DerivedType, ContainedType >.GetItems ( Type  T)
inlinestatic

(non-generic) Gets the ComponentSettings list for T and filters the instances that are not T.

Parameters
T
Returns

◆ GetItems&lt; T &gt;()

static IList< T > OpenTap.ComponentSettingsList< DerivedType, ContainedType >.GetItems< T > ( )
inlinestatic

Gets the ComponentSettings list for T and filters the instances that are not T.

Returns

◆ IndexOf() [1/2]

int OpenTap.ComponentSettingsList< DerivedType, ContainedType >.IndexOf ( ContainedType  item)
inline

Returns the index of the first occurrences of a specified element in the collection.

Parameters
item
Returns

◆ IndexOf() [2/2]

int OpenTap.ComponentSettingsList< DerivedType, ContainedType >.IndexOf ( object  value)
inline

Returns the index of the first occurrences of a specified element in the collection.

Parameters
value
Returns

◆ Insert() [1/2]

void OpenTap.ComponentSettingsList< DerivedType, ContainedType >.Insert ( int  index,
ContainedType  item 
)
inline

Insert an element into the collection at the specified index.

Parameters
index
item

◆ Insert() [2/2]

void OpenTap.ComponentSettingsList< DerivedType, ContainedType >.Insert ( int  index,
object  value 
)
inline

Insert an element into the collection at the specified index.

Parameters
index
value

◆ Remove() [1/2]

bool OpenTap.ComponentSettingsList< DerivedType, ContainedType >.Remove ( ContainedType  item)
inline

Removes the first occurrence of a specified element from the collection.

Parameters
item
Returns

◆ Remove() [2/2]

void OpenTap.ComponentSettingsList< DerivedType, ContainedType >.Remove ( object  value)
inline

Removes the first occurrence of a specified element from the collection.

Parameters
value

◆ RemoveAt()

void OpenTap.ComponentSettingsList< DerivedType, ContainedType >.RemoveAt ( int  index)
inline

Removes an element at a specified index.

Parameters
index

Property Documentation

◆ this[int index]

ContainedType OpenTap.ComponentSettingsList< DerivedType, ContainedType >.this[int index]
getset

List interface

Parameters
index
Returns

OpenTAP 9.27 API built Wed Nov 27 2024 13:14:45