void setField() { Dictionary <string, Dictionary <int, string> > ext = consumer.ExtAliases; ext.Clear(); IFieldConsumer c = consumer; for (int i = 0; i < fieldCombo.Count; i++) { IPhysicalField ph = c[i]; string fn = consumer.GetRelativeName(ph as IAssociatedObject); Dictionary <int, string> d = null; List <ComboBox> lb = fieldCombo[i]; for (int j = 0; j < ph.Count; j++) { ComboBox cb = lb[j]; object it = cb.SelectedItem; if (it == null) { continue; } if (d == null) { d = new Dictionary <int, string>(); ext[fn] = d; } d[j] = it + ""; } } }
void selectField() { Dictionary <string, Dictionary <int, string> > ext = consumer.ExtAliases; IFieldConsumer c = consumer; for (int i = 0; i < fieldCombo.Count; i++) { IPhysicalField ph = c[i]; string fn = consumer.GetRelativeName(ph as IAssociatedObject); if (!ext.ContainsKey(fn)) { continue; } Dictionary <int, string> d = ext[fn]; List <ComboBox> lb = fieldCombo[i]; for (int j = 0; j < ph.Count; j++) { if (!d.ContainsKey(j)) { continue; } string s = d[j]; ComboBox b = lb[j]; b.SelectCombo(s); } } }
private void setField() { fieldAliases.Clear(); IFieldConsumer c = this; foreach (string fn in extAliases.Keys) { Dictionary <int, string> an = extAliases[fn]; foreach (IPhysicalField field in fields) { string na = this.GetRelativeName(field as IAssociatedObject); if (na.Equals(fn)) { Dictionary <int, Transformer> d = new Dictionary <int, Transformer>(); fieldAliases[field] = d; foreach (int num in an.Keys) { AliasName aln = this.FindAliasName(an[num], true); Transformer tr = new Transformer(); tr.an = aln; tr.tr = FieldTransformer.Create(field.GetType(num), field.GetTransformationType(num)); d[num] = tr; } } } } }
IPhysicalField IFieldFactory.GetField(IFieldConsumer consumer, object obj) { if (obj is IAssociatedObject) { IAssociatedObject ao = obj as IAssociatedObject; object o = ao.GetObject <PhysicalField.Interfaces.IPhysicalField>(); } return(null); }
private void buttonUpdate_Click(object sender, EventArgs e) { IFieldConsumer c = consumer; c.Consume(); IDesktop r = label.Root.Desktop; if (r is PanelDesktop) { PanelDesktop d = r as PanelDesktop; d.Refresh(); } }
void fillField() { Panel p = panelFieldParameters; p.Controls.Clear(); fieldCombo.Clear(); IFieldConsumer cons = consumer; int y = 0; for (int i = 0; i < cons.Count; i++) { IPhysicalField ph = cons[i]; Control h = DataPerformer.UI.HeaderControl.GetHeaderControl(consumer as IAssociatedObject, ph as IAssociatedObject); h.Left = 0; h.Top = y; p.Controls.Add(h); y = h.Bottom; List <ComboBox> lb = new List <ComboBox>(); fieldCombo.Add(lb); for (int j = 0; j < ph.Count; j++) { object t = ph.GetType(j); string tn = " (" + Measurement.GetTypeName(t) + ")"; Label l = new Label(); l.Text = ResourceService.Resources.GetControlResource("Parameter", Motion6D.UI.Utils.ControlUtilites.Resources) + " " + (j + 1) + tn; l.Left = 10; l.Top = y; l.Width = 400; p.Controls.Add(l); ComboBox cb = new ComboBox(); lb.Add(cb); cb.Top = l.Bottom + 5; cb.Left = l.Left + 50; cb.Width = p.Width - cb.Left - 20; p.Controls.Add(cb); IList <string> list = consumer.GetAliases(t); cb.FillCombo(list); y = cb.Bottom + 5; } Panel sep = new Panel(); sep.Width = p.Width - 20; sep.BackColor = Color.Black; sep.Height = 3; sep.Top = y; p.Controls.Add(sep); y = sep.Bottom; } selectField(); }