public List <string> GetListFunction(string ObjName) { object ObjValue; if (!ObjValues.TryGetValue(ObjName, out ObjValue)) { throw new ApplicationException(string.Concat( "Obyek ", ObjName, " tidak ditemukan")); } Dictionary <string, ObjMember> Members; if (!ObjDict.TryGetValue(ObjValue.GetType().Name, out Members)) { throw new ApplicationException(string.Concat( "Obyek ", ObjName, " tidak ditemukan")); } List <string> RetVal = new List <string>(); foreach (ObjMember objm in Members.Values) { string Tmpf = objm.ToString(); if (Tmpf.Length > 0) { RetVal.Add(Tmpf); } } return(RetVal); }
public override bool Call(bool isCallvirt, DmdMethodBase method, ILValue[] arguments, out ILValue?returnValue) { switch (method.SpecialMethodKind) { case DmdSpecialMethodKind.Array_Get: returnValue = LoadArrayElement(GetZeroBasedIndex(arguments, arguments.Length)); return(returnValue is not null); case DmdSpecialMethodKind.Array_Set: StoreArrayElement(GetZeroBasedIndex(arguments, arguments.Length - 1), arguments[arguments.Length - 1]); returnValue = null; return(true); case DmdSpecialMethodKind.Array_Address: uint index = GetZeroBasedIndex(arguments, arguments.Length); var addrValue = ObjValue.GetArrayElementAddressAt(index); if (addrValue is not null) { runtime.RecordValue(addrValue.Value); Debug.Assert(addrValue.Value.Value !.Type.IsByRef); returnValue = new ByRefILValueImpl(runtime, addrValue.Value.Value); } else { returnValue = new ArrayElementAddress(runtime, this, index); } return(true); } return(base.Call(isCallvirt, method, arguments, out returnValue)); }
public bool Equals(S other) { if (other == null) { return(false); } return(ObjValue.Equals(other.ObjValue)); }
public override bool Equals(Object obj) { //Check for null and compare run-time types. if ((obj == null) || (!(obj is S))) { return(false); } return(ObjValue.Equals(((S)obj).ObjValue)); }
void InitializeArrayInfo() { if (dimensionInfos is not null) { return; } if (!ObjValue.GetArrayInfo(out elementCount, out dimensionInfos)) { throw new InvalidOperationException(); } }
public object GetValue(string ObjName, string MemberName, params object[] Parameters) { object ObjValue; if (!ObjValues.TryGetValue(ObjName, out ObjValue)) { if (ObjName.Length > 0) { throw new ApplicationException(string.Concat( "Obyek ", ObjName, " tidak ditemukan")); } else { throw new ApplicationException(string.Concat( "Variabel '", MemberName, "' tidak ditemukan")); } } Dictionary <string, ObjMember> Members; if (!ObjDict.TryGetValue(ObjValue.GetType().Name, out Members)) { if (ObjName.Length > 0) { throw new ApplicationException(string.Concat( "Obyek ", ObjName, " tidak ditemukan")); } else { throw new ApplicationException(string.Concat( "Variabel '", MemberName, "' tidak ditemukan")); } } ObjMember ObjMember; if (Members.TryGetValue(MemberName, out ObjMember)) { return(ObjMember.GetValue(ObjValue, Parameters)); } else if (ObjName.Length > 0) { throw new ApplicationException(string.Concat( "Obyek ", ObjName, " Member ", MemberName, " tidak ditemukan")); } else { throw new ApplicationException(string.Concat( "Variabel '", MemberName, "' tidak ditemukan")); } }
public override string ToString() { return(ObjValue.ToString()); }