private DataGridViewTextBoxCell GetContainerCell(ISpectraContainer container) { DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell(); cell.Value = container; return(cell); }
new public void RemoveAt(int id) { Binding binding = this[id]; if (binding is ParameterBinding) { foreach (IParameter parameter in ((ParameterBinding)binding).Parameters) { ParameterLocation pl = _parent.GetParameterLocation(parameter); ISpectraContainer container = _parent.Containers[pl.docId]; IParameter topParameter = null; for (int specId = 0; specId < container.Spectra.Count; specId++) { pl.specId = specId; IParameter p = _parent.GetParameter(pl); p.Status &= ~ParameterStatus.Binding; p.ReferencedParameter = topParameter; if (specId == 0) { topParameter = p; } } } } binding.Dispose(); base.RemoveAt(id); }
public SpectraContainerTabPage(ISpectraContainer container, ProjectForm projectForm) : base(container.Name) { this._container = container; this.Name = container.Name; this._projectForm = projectForm; _groupsControl = new TabControl(); _groupsControl.Name = "groupsControl"; _groupsControl.Parent = this; _groupsControl.Dock = DockStyle.Fill; int id = 0; foreach (IGroup group in container.Spectra[0].Parameters) { if (!projectForm.project.BindingsManager.Contains(container, group.Definition.name)) { GroupDefinition gd = group.Definition; if ((gd.Type & GroupType.Hidden) != GroupType.Hidden) { //_groupsControl.TabPages.Add(new GroupTabPage(container.Spectra, gd, projectForm.statusStrip1, _groupsControl)); InsertGroupTabPage(gd.name, id++); } } } //if (projectForm.project.BindingsManager.Contains(container)) // SortableGroupGrids = false; }
public SpectraDialog(ISpectraContainer spectraContainer) : this() { foreach (ISpectrum spectrum in spectraContainer.Spectra) { //spectraList.Items.Add(spectrum.Path); spectraList.Items.Add(spectrum); } button1.Enabled = spectraList.Items.Count > 0; }
public ListBoxParameterItem(IParameter parameter, IGroup group, ISpectraContainer container, ListBox parent, bool inBinding) { this.parameter = parameter; this.group = group; this.container = container; //this.bkBrush = bkBrush; this.inBinding = false; this.parent = parent; this.inBinding = inBinding; }
public IEnumerable <Binding> GetBindings(ISpectraContainer container) { for (int i = 0; i < this.Count; i++) { if (this[i].ContainsContainer(container)) { yield return(this[i]); } } }
public bool ContainsContainer(ISpectraContainer container) { for (int i = 0; i < this.Containers.Length; i++) { if (this.Containers[i] == container) { return(true); } } return(false); }
public bool ContainsBinding(ISpectraContainer container, string groupName) { for (int i = 0; i < Containers.Length; i++) { if (Containers[i] == container) { return(ContainsGroup(groupName)); } } return(false); }
public virtual ISpectraContainer AddSpectraContainer(ISpectraContainer container) { Type sct = GetSpectraContainerType(); if (container.GetType() != sct) { throw new ArgumentException(String.Format("Invalid spectra container class: {0}. Expecting {1}", container.GetType(), sct)); } else { this._containers.Add(container); return(container); } }
public bool Contains(ISpectraContainer container) { for (int i = 0; i < Count; i++) { if (this[i] is GroupBinding) { if (((GroupBinding)this[i]).ContainsContainer(container)) { return(true); } } } return(false); }
new public void Add(Binding binding) { base.Add(binding); if (binding is ParameterBinding) { foreach (IParameter parameter in ((ParameterBinding)binding).Parameters) { ParameterLocation pl = _parent.GetParameterLocation(parameter); ISpectraContainer container = _parent.Containers[pl.docId]; foreach (IParameter p in container.GetParameters(parameter, true)) { p.Status = ((ParameterBinding)binding).Source.Status; p.ReferencedParameter = ((ParameterBinding)binding).Source; } } } }
private void populateGroupNamesList() { listGroupNames.Items.Clear(); btnOK.Enabled = false; if (listChosenDocs.Items.Count > 1) { bool bindableGroup; int i, j; string groupName; ISpectraContainer container = (ISpectraContainer)listChosenDocs.Items[0]; ISpectraContainer currentContainer; for (i = 0; i < container.Spectra[0].Parameters.GroupCount; i++) { groupName = container.Spectra[0].Parameters[i].Definition.name; if (((container.Spectra[0].Parameters[i].Definition.Type & GroupType.Hidden) == 0)) { if (!_project.BindingsManager.Contains(container, groupName)) { bindableGroup = true; for (j = 1; j < listChosenDocs.Items.Count; j++) { currentContainer = (ISpectraContainer)listChosenDocs.Items[j]; bindableGroup &= currentContainer.Spectra[0].Parameters.ContainsGroup(groupName) && !_project.BindingsManager.Contains(currentContainer, groupName); if (bindableGroup) { bindableGroup &= currentContainer.Spectra[0].Parameters[groupName].Definition == container.Spectra[0].Parameters[groupName].Definition; } } if (bindableGroup) { listGroupNames.Items.Add(groupName); } } else if (this._binding != null) { if (this._binding.ContainsGroup(groupName)) { listGroupNames.Items.Add(groupName, true); btnOK.Enabled = true; } } } } } }
public virtual bool RemoveContainer(ISpectraContainer container) { return(this._containers.Remove(container)); }
public AnhSpectrum(string path, ISpectraContainer container, int bufferStart) : base(path, container, bufferStart) { }
public AnhSpectrum(XmlReader spectrumReader, string root, ISpectraContainer container, int bufferStart) : base(spectrumReader, root, container, bufferStart) { }
private void checkedListBox1_Format(object sender, ListControlConvertEventArgs e) { ISpectraContainer container = (ISpectraContainer)e.ListItem; e.Value = String.Format("{0} ({1})", container.Name, container.Model.Name); }