public void RebuildInfo(object obj) { if (fpInfos.Count < 1) { Console.Write("There were not keys in fpInfos while Rebuilding the Info"); return; } fpInfosObj = new Dictionary <string, object>(); foreach (string key in fpInfos.Keys) { fpInfos[key] = new FPInfo(fpInfos[key].Name, obj); fpInfosObj.Add(key, obj); } }
public QueueInfo( FPInfo fpInfo, object obj, int queuecount, string id = "" //Type type = typeof(object) ) { this.fpInfo = fpInfo; this.obj = obj; this.queuecount = queuecount; this.id = id; //this.elementType = type; this.queue = new Queue <object>(); }
public void AddFPInfoFromString(string id, string fieldname, object obj) { FPInfo fpInfo = new FPInfo(fieldname, obj); if (fpInfos.ContainsKey(id)) { Console.WriteLine("[{0}] was already found in the dictionary", id); return; } if (fpInfosObj.ContainsKey(id)) { Console.WriteLine("[{0}] was already found in the dictionary", id); return; } fpInfos.Add(id, fpInfo); fpInfosObj.Add(id, obj); }
public FPInfo(FPInfo old) //for copying component use { this.propertyInfo = old.propertyInfo; this.fieldInfo = old.fieldInfo; if (propertyInfo != null) { Name = propertyInfo.Name; DeclaringTypeName = propertyInfo.DeclaringType.ToString(); } else if (fieldInfo != null) { Name = fieldInfo.Name; DeclaringTypeName = fieldInfo.DeclaringType.ToString(); } else if (old.DeclaringTypeName != null) { //PropertyInfo pi = old.DeclaringTypeName.GetProperty(old.Name); PropertyInfo pi = Type.GetType(old.DeclaringTypeName).GetProperty(old.Name); if (pi != null) { this.propertyInfo = pi; Name = old.Name; return; } //FieldInfo fi = old.DeclaringTypeName.GetField(old.Name); FieldInfo fi = Type.GetType(old.DeclaringTypeName).GetField(old.Name); if (fi != null) { this.fieldInfo = fi; Name = old.Name; return; } } else { Name = "error_Name_2"; } //ob = null; }
public void AddFPInfoObject(string id, FPInfo fpInfo, object obj) { fpInfos.Add(id, fpInfo); fpInfosObj.Add(id, obj); }