MfCollection

Namespace ›› System ››
Parent Previous Next

MfCollection Class

(Inherits from MfCollectionBase)

Provides the class for a strongly typed collection.

Links

Properties, Methods

Constructors


Name

Description

Constructor()

Constructor for MfCollection Class

Properties


Name

Description

Count

Gets the number of elements contained in the MfCollectionBase instance. This property cannot be overridden. Inherited from MfCollectionBase

InnerList

Gets an MfList containing the list of elements in the MfCollectionBase instance. Inherited from MfCollectionBase

Item

Gets or sets the element at the specified index. Inherited from MfCollectionBase

IsFixedSize

Gets a value indicating whether the MfCollectionBase has a fixed size. Inherited from MfCollectionBase

IsReadonly

Gets a value indicating whether the MfCollectionBase is read-only. Inherited from MfCollectionBase

Methods


Name

Description

_NewEnum()

Returns a new enumerator to enumerate this object's key-value pairs. This method is usually not called directly, but by the for-loop or by GetEnumerator(). Overrides MfEnumerableBase._NewEnum() Inherited from MfCollectionBase

Add(obj)

Adds an object to the end of the MfCollectionBase. Inherited from MfCollectionBase

AddAttribute()

Adds MfAttribute extended items to extended classes. Inherited from MfObject.

Clear()

Removes all objects from the MfCollectionBase instance. This method in not to be overridden. Inherited from MfCollectionBase

CompareTo()

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. Inherited from MfObject.

Contains(obj)

Determines whether the MfCollectionBase contains a specific element. Inherited from MfCollectionBase

Equals(obj)

Compares obj to current instance to see if they are the same. Inherited from MfObject.

GetAttribute(index)

Gets an MfAttribute of the class. Inherited from MfObject.

GetAttributes()

Gets a MfGenericList of MfAttribute that Contains the attributes for the current class instance. Inherited from MfObject.

GetEnumerator()

Gets an enumerator. Inherited from MfEnumerableBase

GetIndexOfAttribute(attrib)

Gets the zero-based index value of the position of MfAttribute within the instance of the class. Inherited from MfObject.

GetType()

Gets the Type for the for the Class .Inherited from MfObject.

HasAttribute(attrib)

Gets if the current instance of class derived from MfSystemException has MfAttribute. Inherited from MfObject.

Is(type)

Gets if current instance of object is of the same type. Inherited from MfObject. Inherited from MfObject.

IndexOf(obj)

Searches for the specified Object and returns the zero-based index of the first occurrence within the entire MfCollectionBase. Inherited from MfCollectionBase

Insert(index, obj)

Inserts an element into the MfCollectionBase at the specified index. Inherited from MfCollectionBase

IsInstance()

Get if the current class is an instance. Inherited from MfObject.

MemberwiseClone()

Creates a shallow copy of the current MfObject instance. Inherited from MfObject.

OnClear()

Performs additional custom processes when clearing the contents of the MfCollectionBase instance. Inherited from MfCollectionBase

OnClearComplete()

Performs additional custom processes after clearing the contents of the MfCollectionBase instance. Inherited from MfCollectionBase

OnInsert(index, value)

Performs additional custom processes before inserting a new element into the MfCollectionBase instance. Inherited from MfCollectionBase

OnInsertComplete(index, value)

Performs additional custom processes after inserting a new element into the MfCollectionBase instance. Inherited from MfCollectionBase

OnRemove(index, value)

Performs additional custom processes when removing an element from the MfCollectionBase instance. Inherited from MfCollectionBase

OnRemoveComplete(index, value)

Performs additional custom processes when removing an element from the MfCollectionBase instance. Inherited from MfCollectionBase

OnSet(index, oldValue, newValue)

Performs additional custom processes before setting a value in the MfCollectionBase instance. Inherited from MfCollectionBase

OnSetComplete(index, oldValue, newValue)

Performs additional custom processes after setting a value in the MfCollectionBase instance. Inherited from MfCollectionBase

OnValidate(value)

Performs additional custom processes when validating a value. Inherited from MfCollectionBase

Remove(obj)

Removes the first occurrence of a specific object from the MfCollectionBase. Inherited from MfCollectionBase

RemoveAt(index)

Removes the element at the specified index of the MfCollectionBase instance. Inherited from MfCollectionBase

ToString()

Gets a string representation of the MfObject. Inherited from MfObject.

VerifyIsInstance([ClassName, LineFile, LineNumber, Source])

Verifies the the current object is set to an instance. Inherited from MfObject.

VerifyIsNotInstance([MethodName, LineFile, LineNumber, Source])

Verifies the the current object is NOT set to an instance. Used in Static methods. Inherited from MfObject.

Example

mfCol := new MfCollection()
i := 0
iEnd := 10
While, (i < iEnd)
{
   if (Mod(i, 2)) ; only odd numbers
   {
       mss := new MfString()
       mss.Value := MfString.Format("String Value: '{0}'", i)
       mfCol.Add(mss)
   }
   else
   {
       msi := new MfInteger(i)
       mfCol.Add(msi)
   }
   i++
}

mfsOutput := new MfString()
mfiOutput := new MfInteger()

For i, var in mfCol
{
   if (MfObject.IsObjInstance(var, MfString))
   {
       mfsOutput.AppendLine(var)
   }
   else if (MfObject.IsObjInstance(var, MfInteger))
   {
       mfiOutput.Add(var)
   }
}

MsgBox, 64, Text, % mfsOutput.Value
MsgBox, 64, Total, % mfiOutput.ToString()