This commit is contained in:
luosheng
2023-07-16 08:17:03 +08:00
parent 6d655b24d1
commit 2055c10c59
127 changed files with 7414 additions and 7470 deletions

View File

@@ -27,84 +27,84 @@ using System.Collections;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>A collection of subscriptions.</summary>
[Serializable]
public class TsCDaSubscriptionCollection : ICollection, ICloneable, IList
{
///////////////////////////////////////////////////////////////////////
#region Fields
/// <summary>A collection of subscriptions.</summary>
[Serializable]
public class TsCDaSubscriptionCollection : ICollection, ICloneable, IList
{
///////////////////////////////////////////////////////////////////////
#region Fields
private ArrayList _subscriptions = new ArrayList();
private ArrayList _subscriptions = new ArrayList();
#endregion
#endregion
///////////////////////////////////////////////////////////////////////
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes object with the default values.
/// </summary>
public TsCDaSubscriptionCollection() { }
///////////////////////////////////////////////////////////////////////
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes object with the specified SubscriptionCollection object.
/// </summary>
public TsCDaSubscriptionCollection(TsCDaSubscriptionCollection subscriptions)
{
if (subscriptions != null)
{
foreach (TsCDaSubscription subscription in subscriptions)
{
Add(subscription);
}
}
}
/// <summary>
/// Initializes object with the default values.
/// </summary>
public TsCDaSubscriptionCollection() { }
#endregion
/// <summary>
/// Initializes object with the specified SubscriptionCollection object.
/// </summary>
public TsCDaSubscriptionCollection(TsCDaSubscriptionCollection subscriptions)
{
if (subscriptions != null)
{
foreach (TsCDaSubscription subscription in subscriptions)
{
Add(subscription);
}
}
}
///////////////////////////////////////////////////////////////////////
#region Properties
#endregion
/// <summary>
/// Gets the item at the specified index.
/// </summary>
public TsCDaSubscription this[int index]
{
get => (TsCDaSubscription)_subscriptions[index];
///////////////////////////////////////////////////////////////////////
#region Properties
/// <summary>
/// Gets the item at the specified index.
/// </summary>
public TsCDaSubscription this[int index]
{
get => (TsCDaSubscription)_subscriptions[index];
set => _subscriptions[index] = value;
}
#endregion
#endregion
///////////////////////////////////////////////////////////////////////
#region ICloneable Members
///////////////////////////////////////////////////////////////////////
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCDaSubscriptionCollection)MemberwiseClone();
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCDaSubscriptionCollection)MemberwiseClone();
clone._subscriptions = new ArrayList();
clone._subscriptions = new ArrayList();
foreach (TsCDaSubscription subscription in _subscriptions)
{
clone._subscriptions.Add(subscription.Clone());
}
foreach (TsCDaSubscription subscription in _subscriptions)
{
clone._subscriptions.Add(subscription.Clone());
}
return clone;
}
return clone;
}
#endregion
#endregion
///////////////////////////////////////////////////////////////////////
#region ICollection Members
///////////////////////////////////////////////////////////////////////
#region ICollection Members
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public bool IsSynchronized => false;
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public bool IsSynchronized => false;
/// <summary>
/// Gets the number of objects in the collection.
@@ -117,150 +117,150 @@ namespace Technosoftware.DaAeHdaClient.Da
/// <param name="array">The one-dimensional Array that is the destination for the objects.</param>
/// <param name="index">The zero-based index in the Array at which copying begins.</param>
public void CopyTo(Array array, int index)
{
if (_subscriptions != null)
{
_subscriptions.CopyTo(array, index);
}
}
{
if (_subscriptions != null)
{
_subscriptions.CopyTo(array, index);
}
}
/// <summary>
/// Copies the objects to an Array, starting at a the specified index.
/// </summary>
/// <param name="array">The one-dimensional Array that is the destination for the objects.</param>
/// <param name="index">The zero-based index in the Array at which copying begins.</param>
public void CopyTo(TsCDaSubscription[] array, int index)
{
CopyTo((Array)array, index);
}
/// <summary>
/// Copies the objects to an Array, starting at a the specified index.
/// </summary>
/// <param name="array">The one-dimensional Array that is the destination for the objects.</param>
/// <param name="index">The zero-based index in the Array at which copying begins.</param>
public void CopyTo(TsCDaSubscription[] array, int index)
{
CopyTo((Array)array, index);
}
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public object SyncRoot => this;
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public object SyncRoot => this;
#endregion
///////////////////////////////////////////////////////////////////////
#region IEnumerable Members
///////////////////////////////////////////////////////////////////////
#region IEnumerable Members
/// <summary>
/// Returns an enumerator that can iterate through a collection.
/// </summary>
/// <returns>An IEnumerator that can be used to iterate through the collection.</returns>
public IEnumerator GetEnumerator()
{
return _subscriptions.GetEnumerator();
}
/// <summary>
/// Returns an enumerator that can iterate through a collection.
/// </summary>
/// <returns>An IEnumerator that can be used to iterate through the collection.</returns>
public IEnumerator GetEnumerator()
{
return _subscriptions.GetEnumerator();
}
#endregion
#endregion
///////////////////////////////////////////////////////////////////////
#region IList Members
///////////////////////////////////////////////////////////////////////
#region IList Members
/// <summary>
/// Gets a value indicating whether the IList is read-only.
/// </summary>
public bool IsReadOnly => false;
/// <summary>
/// Gets a value indicating whether the IList is read-only.
/// </summary>
public bool IsReadOnly => false;
/// <summary>
/// Gets or sets the element at the specified index.
/// </summary>
object IList.this[int index]
{
get => _subscriptions[index];
{
get => _subscriptions[index];
set
{
if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
{
throw new ArgumentException("May only add Subscription objects into the collection.");
}
{
if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
{
throw new ArgumentException("May only add Subscription objects into the collection.");
}
_subscriptions[index] = value;
}
}
_subscriptions[index] = value;
}
}
/// <summary>
/// Removes the IList subscription at the specified index.
/// </summary>
/// <param name="index">The zero-based index of the subscription to remove.</param>
public void RemoveAt(int index)
{
_subscriptions.RemoveAt(index);
}
/// <summary>
/// Removes the IList subscription at the specified index.
/// </summary>
/// <param name="index">The zero-based index of the subscription to remove.</param>
public void RemoveAt(int index)
{
_subscriptions.RemoveAt(index);
}
/// <summary>
/// Inserts an subscription to the IList at the specified position.
/// </summary>
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
public void Insert(int index, object value)
{
if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
{
throw new ArgumentException("May only add Subscription objects into the collection.");
}
/// <summary>
/// Inserts an subscription to the IList at the specified position.
/// </summary>
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
public void Insert(int index, object value)
{
if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
{
throw new ArgumentException("May only add Subscription objects into the collection.");
}
_subscriptions.Insert(index, value);
}
_subscriptions.Insert(index, value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(object value)
{
_subscriptions.Remove(value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(object value)
{
_subscriptions.Remove(value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(object value)
{
return _subscriptions.Contains(value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(object value)
{
return _subscriptions.Contains(value);
}
/// <summary>
/// Removes all subscriptions from the IList.
/// </summary>
public void Clear()
{
_subscriptions.Clear();
}
/// <summary>
/// Removes all subscriptions from the IList.
/// </summary>
public void Clear()
{
_subscriptions.Clear();
}
/// <summary>
/// Determines the index of a specific subscription in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(object value)
{
return _subscriptions.IndexOf(value);
}
/// <summary>
/// Determines the index of a specific subscription in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(object value)
{
return _subscriptions.IndexOf(value);
}
/// <summary>
/// Adds an subscription to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(object value)
{
if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
{
throw new ArgumentException("May only add Subscription objects into the collection.");
}
/// <summary>
/// Adds an subscription to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(object value)
{
if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
{
throw new ArgumentException("May only add Subscription objects into the collection.");
}
return _subscriptions.Add(value);
}
return _subscriptions.Add(value);
}
/// <summary>
/// Indicates whether the IList has a fixed size.
/// </summary>
public bool IsFixedSize => false;
/// <summary>
/// Indicates whether the IList has a fixed size.
/// </summary>
public bool IsFixedSize => false;
/// <summary>
/// Inserts an subscription to the IList at the specified position.
@@ -268,49 +268,49 @@ namespace Technosoftware.DaAeHdaClient.Da
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
public void Insert(int index, TsCDaSubscription value)
{
Insert(index, (object)value);
}
{
Insert(index, (object)value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(TsCDaSubscription value)
{
Remove((object)value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(TsCDaSubscription value)
{
Remove((object)value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(TsCDaSubscription value)
{
return Contains((object)value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(TsCDaSubscription value)
{
return Contains((object)value);
}
/// <summary>
/// Determines the index of a specific subscription in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(TsCDaSubscription value)
{
return IndexOf((object)value);
}
/// <summary>
/// Determines the index of a specific subscription in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(TsCDaSubscription value)
{
return IndexOf((object)value);
}
/// <summary>
/// Adds an subscription to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(TsCDaSubscription value)
{
return Add((object)value);
}
/// <summary>
/// Adds an subscription to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(TsCDaSubscription value)
{
return Add((object)value);
}
#endregion
}
#endregion
}
}