(Inherits from MfDictionaryBase)
Provides class for a strongly typed collection of key/value pairs.
Name |
Description |
|
Constructor for MfDictionary Class |
||
Constructs new instance of MfDictionary Class and sets the initial capacity. |
Name |
Description |
|
Gets the number of elements contained in the MfDictionaryBase instance.. This property cannot be overridden. Inherited from MfDictionaryBase |
||
Gets the list of elements contained in the MfDictionaryBase instance Inherited from MfDictionaryBase |
||
Gets the list of elements contained in the MfDictionaryBase instance. Inherited from MfDictionaryBase |
||
Gets a value indicating whether the MfDictionary is a fixed size. Overrides MfDictionaryBase.IsFixedSize |
||
Gets a value indicating whether the MfDictionary is read-only. Overrides MfDictionaryBase.IsFixedSize |
||
Gets or sets the element at the specified index. Inherited from MfDictionaryBase |
||
Gets an MfCollection instance containing the keys in the MfDictionaryBase instance. Inherited from MfDictionaryBase |
||
Gets an MfCollection instance containing the values in the MfDictionaryBase instance. Inherited from MfDictionaryBase |
Name |
Description |
|
Returns a new enumerator to enumerate this object's key-value pairs. Overrides MfEnumerableBase._NewEnum() |
||
Adds an element with the specified key and value into the MfDictionaryBase instance Inherited from MfDictionaryBase |
||
Adds MfAttribute extended items to extended classes. Inherited from MfObject. |
||
Clears the contents of the MfDictionaryBase instance.. This method in not to be overridden. Inherited from MfDictionaryBase |
||
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. |
||
Determines whether the MfDictionaryBase contains a specific element. Inherited from MfDictionaryBase |
||
Determines whether the MfCollectionBase contains a specific element. Inherited from MfDictionaryBase |
||
Compares obj to current instance to see if they are the same. Inherited from MfObject. |
||
Gets an MfAttribute of the class. Inherited from MfObject. |
||
Gets a MfGenericList of MfAttribute that Contains the attributes for the current class instance. Inherited from MfObject. |
||
Gets an enumerator. Inherited from MfEnumerableBase |
||
Gets the zero-based index value of the position of MfAttribute within the instance of the class. Inherited from MfObject. |
||
Gets the Type for the for the Class .Inherited from MfObject. |
||
Gets if the current instance of class derived from MfSystemException has MfAttribute. Inherited from MfObject. |
||
Gets if current instance of object is of the same type. Inherited from MfObject. Inherited from MfObject. |
||
Get if the current class is an instance. Inherited from MfObject. |
||
Creates a shallow copy of the current MfObject instance. Inherited from MfObject. |
||
Performs additional custom processes when clearing the contents of the MfDictionaryBase instance Inherited from MfDictionaryBase |
||
Performs additional custom processes after clearing the contents of the MfDictionaryBase instance. Inherited from MfDictionaryBase |
||
Performs additional custom processes before inserting a new element into the MfDictionaryBase instance. Inherited from MfDictionaryBase |
||
Performs additional custom processes after inserting a new element into the MfDictionaryBase instance. Inherited from MfDictionaryBase |
||
Performs additional custom processes before removing an element from the current instance. Inherited from MfDictionaryBase |
||
Performs additional custom processes after removing an element from the MfDictionaryBase instance. Inherited from MfDictionaryBase |
||
Performs additional custom processes before setting a value in the MfDictionaryBase instance. Inherited from MfDictionaryBase |
||
Performs additional custom processes after setting a value in the MfDictionaryBase instance. Inherited from MfDictionaryBase |
||
Performs additional custom processes when validating a value. Inherited from MfDictionaryBase |
||
Removes the first occurrence of a specific object from the MfDictionaryBase. Inherited from MfDictionaryBase |
||
Gets a string representation of the MfObject. Inherited from MfObject. |
||
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. |
mfDic := new MfDictionary()
stud1 := new Student()
stud1.Id := "RT34TTTSV"
stud1.Name := "Frank Smith"
stud1.Age := 21
stud1.HomeRoom := "English 101"
mfDic.Add(stud1.Id, stud1)
stud2 := new Student()
stud2.Id := "WRT556SV"
stud2.Name := "Sue Smith"
stud2.Age := 20
stud2.HomeRoom := "French 102"
if (mfDic.Contains(stud2.id) = false)
{
mfDic.Add(stud2.Id, stud2)
}
stud3 := new Student()
stud3.Id := "GTUFF7SV"
stud3.Name := "Bob Smith"
stud3.Age := 22
stud3.HomeRoom := "Math 201"
if (mfDic.Contains(stud3.Id) = false)
{
mfDic.Add(stud3.Id, stud3)
}
MsgBox % mfDic.Item["GTUFF7SV"].HomeRoom ; Math 201
mfsHomeScience := new MfString("Science 504")
mfDic.Item["GTUFF7SV"].HomeRoom := mfsHomeScience
MsgBox % mfDic.Item["GTUFF7SV"].HomeRoom ; Science 504
MsgBox, 64, Student Count, % MfString.Format("There are currently {0} Students", mfDic.Count)
for key, st in mfDic
{
st.EnrollmentYear := A_Year
}
MsgBox % mfDic.Item["WRT556SV"].EnrollmentYear
ExitApp
Class Student extends MfObject
{
m_Id := ""
m_Name := ""
m_Age := 0
m_HomeRoom := ""
m_EnrollmentYear := 0
Id[]
{
get {
return this.m_Id
}
set {
this.m_Id := MfString.GetValue(value)
return this.m_Id
}
}
Name[]
{
get {
return this.m_Name
}
set {
this.m_Name := MfString.GetValue(value)
return this.m_Name
}
}
Age[]
{
get {
return this.m_Age
}
set {
this.m_Age := MfInteger.GetValue(value, 0)
return this.m_Age
}
}
HomeRoom[]
{
get {
return this.m_HomeRoom
}
set {
this.m_HomeRoom := MfString.GetValue(value)
return this.m_HomeRoom
}
}
EnrollmentYear[]
{
get {
return this.m_EnrollmentYear
}
set {
this.m_EnrollmentYear := MfInteger.GetValue(value, 0)
return this.m_EnrollmentYear
}
}
; Override ToString()
ToString()
{
; throw an error if called as static method
this.VerifyIsInstance(this, A_LineFile, A_LineNumber, A_ThisFunc)
return MfString.Format("ID:'{0}', Name:'{1}', Age:'{2}'", this.Id, this.Name, this.Age)
}
}