/// <summary> /// Constructor /// </summary> /// <param name="names">Names</param> /// <param name="consumer">Consumer</param> /// <param name="disassembly">Disassembly</param> public DisassemblyWrapper(IEnumerable <string> names, IDataConsumer consumer, IDisassemblyObject disassembly) { Dictionary <IMeasurement, MeasurementsDisasseblyWrapper> d = consumer.CreateDisassemblyMeasurements(disassembly); Dictionary <string, IMeasurement> measurements = consumer.GetAllMeasurementsByName(); foreach (string key in measurements.Keys) { if (names.Contains(key)) { IMeasurement measurement = measurements[key]; if (d.ContainsKey(measurement)) { string s = key + "."; MeasurementsDisasseblyWrapper wr = d[measurement]; l.Add(wr); IMeasurement[] mea = wr.Measurements; foreach (IMeasurement mm in mea) { dictionary[s + mm.Name] = mm; } continue; } dictionary[key] = measurement; } } }
IDisassemblyObject IDisassemblyObject.this[object type] { get { foreach (IDisassemblyObject d in list) { IDisassemblyObject dob = d[type]; if (dob != null) { return(dob); } } return(null); } }
public MeasurementsDisasseblyWrapper(IDisassemblyObject disassembly, IMeasurement measure) { this.disassembly = disassembly; this.measure = measure; List <Tuple <string, object> > types = disassembly.Types; o[0] = new object[types.Count]; List <IMeasurement> l = new List <IMeasurement>(); string n = measure.Name + "_"; for (int i = 0; i < types.Count; i++) { Tuple <string, object> type = types[i]; o[0][i] = type.Item2; l.Add(new ArrayMeasurement(o, type.Item2, i, n + type.Item1)); } measurements = l.ToArray(); }
/// <summary> /// Adds a disassembly object /// </summary> /// <param name="disassemblyObject">The disassembly object</param> public void Add(IDisassemblyObject disassemblyObject) { list.Add(disassemblyObject); }
/// <summary> /// Adds disasembly object /// </summary> /// <param name="o">Object to add</param> static public void Add(this IDisassemblyObject o) { (disassembly as BaseTypes.DisassemblyObjectList).Add(o); }