protected void Add(object o, DataRow row, TestData test) { IObjectLabel l = o as IObjectLabel; ICategoryObject co = l.Object; string name = l.GetName(collection); if (co is global::Regression.AliasRegression) { test.AddRegression(name, (uint)row[3], collection); return; } if (o is IProperties) { object ob = (o as IProperties).Properties; if (ob.GetType().Equals(typeof(DataPerformer.UI.Labels.GraphLabel))) { /* DataPerformer.UI.Interfaces.IGraphLabel lab = ob as DataPerformer.UI.Labels.GraphLabel; * Tuple<Dictionary<string, Color>[], Dictionary<string, bool>[], * Dictionary<string, string>[], string[], int[]>[] data = null;// lab.Data; * Tuple<Dictionary<string, Color>[], Dictionary<string, bool>[], * Dictionary<string, string>[], string[], int[]> t = data[0]; * Dictionary<string, Color>[] d = t.Item1; * IEnumerable<string> keys = d[0].Keys; * DataPerformer.DataConsumer cons = co as DataPerformer.DataConsumer; * test.AddChart(name, cons.Start, cons.Step, cons.Steps, lab.Data[0].Item4[1], * keys.ToArray<string>(), collection);*/ return; } } onAdd(o, row, test); }
internal void Set(ITest test, IComponentCollection collection) { this.collection = collection; if (test != null) { this.test = test as TestData; output = this.test.Output; } IEnumerable <object> c = collection.AllComponents; foreach (object o in c) { string name = ""; IObjectLabel ol = null; ICategoryObject cob = null; if (o is IObjectLabel) { ol = o as IObjectLabel; cob = ol.Object; name = ol.GetName(collection); } if (IsAdmissible(o, cob)) { l.Add(o); } } List <string> ls = new List <string>(); List <Control> controls = new List <Control>(); uint i = 1; foreach (object o in l) { int num; int count; Create(o, out num, out count); object[] ob = new object[] { i, (o as IObjectLabel).GetName(collection), (uint)num, (uint)count }; dataTable.Rows.Add(ob); ++i; } }
internal bool HasTests(ITest test, IComponentCollection collection) { List <object> l = new List <object>(); IEnumerable <object> c = collection.AllComponents; foreach (object o in c) { string name = ""; IObjectLabel ol = null; ICategoryObject cob = null; if (o is IObjectLabel) { ol = o as IObjectLabel; cob = ol.Object; name = ol.GetName(collection); } if (IsAdmissible(o, cob)) { return(true); } } return(false); }
static private void GetAllAliases(INamedComponent nc, IObjectLabel lab, object labObject, List <string> list, object type) { if (labObject == null) { return; } IDesktop d = nc.Desktop; if (labObject is IAliasBase) { IAliasBase ab = labObject as IAliasBase; if (ab is IAlias) { IAlias al = ab as IAlias; foreach (string s in al.AliasNames) { string str = lab.GetName(d) + "." + s; if (type != null) { if (!al.GetType(s).Equals(type)) { continue; } } if (list.Contains(str)) { continue; } list.Add(lab.GetName(d) + "." + s); } } if (ab is IAliasVector) { IAliasVector av = ab as IAliasVector; foreach (string s in av.AliasNames) { string str = lab.GetName(d) + "." + s; if (type != null) { if (!av.GetType(s).Equals(type)) { continue; } } if (list.Contains(str)) { continue; } list.Add(lab.GetName(d) + "." + s); } } } if (labObject is IChildrenObject) { IChildrenObject co = labObject as IChildrenObject; IAssociatedObject[] children = co.Children; foreach (object child in children) { GetAllAliases(nc, lab, child, list, type); } } }