protected override void Context()
        {
            base.Context();
            _columnWithCompound = PathElementId.Molecule;
            _parameterDTO1.PathElements[PathElementId.TopContainer] = new PathElement {
                DisplayName = "Organsim"
            };
            _parameterDTO1.PathElements[PathElementId.Container] = new PathElement {
                DisplayName = "Liver"
            };
            _parameterDTO1.PathElements[_columnWithCompound] = new PathElement {
                DisplayName = "Drug"
            };
            _parameterDTO2.PathElements[PathElementId.TopContainer] = new PathElement {
                DisplayName = "Organsim"
            };
            _parameterDTO2.PathElements[PathElementId.Container] = new PathElement {
                DisplayName = "Liver"
            };
            _parameterDTO2.PathElements[_columnWithCompound] = new PathElement {
                DisplayName = "Inhibitor"
            };

            _parameters = new List <IParameter> {
                _parameter1, _parameter2
            };


            var simulation = A.Fake <Simulation>();

            A.CallTo(() => simulation.CompoundNames).Returns(new[] { "Drug", "Inhibitor" });
            A.CallTo(_withIdRepository).WithReturnType <Simulation>().Returns(simulation);
        }
Esempio n. 2
0
        public void SetVisibility(PathElementId pathElementId, bool visible)
        {
            var colIndex = _columnPathElementCache.Keys.ToList().IndexOf(pathElementId);

            if (colIndex < 0)
            {
                return;
            }
            ColumnAt(pathElementId).UpdateVisibility(visible);
        }
Esempio n. 3
0
 public void SortColumn(PathElementId pathElementId)
 {
     View.SortedPathElementId = pathElementId;
 }
        public static bool HasOnlyEmptyValuesAt(this IEnumerable <IPathRepresentableDTO> pathRepresentables, PathElementId pathElementId)
        {
            var allValues = pathRepresentables.AllDistinctValuesAt(pathElementId);

            return(allValues.Count == 1 && string.IsNullOrEmpty(allValues[0]));
        }
 public void SetVisibility(PathElementId pathElementId, bool visible)
 {
     _pathElementsBinder.SetVisibility(pathElementId, visible);
 }
 public void Hide(PathElementId pathElementId)
 {
     _allQuantityListPresenter.Hide(pathElementId);
     _selectedQuantityListPresenter.Hide(pathElementId);
 }
 public void SortColumn(PathElementId pathElementId)
 {
     _allQuantityListPresenter.SortColumn(pathElementId);
     _selectedQuantityListPresenter.SortColumn(pathElementId);
 }
Esempio n. 8
0
 private void updateColumnVisibility(PathElementId pathElementId)
 {
     _view.SetVisibility(pathElementId, !_allLinkedParameters.HasOnlyEmptyValuesAt(pathElementId));
 }
Esempio n. 9
0
        private IGridViewAutoBindColumn <T, PathElement> configurePathElement(Expression <Func <T, PathElement> > parameterPathExpression, PathElementId pathElementId, string caption)
        {
            var column = _gridViewBinder.AutoBind(parameterPathExpression)
                         .WithCaption(caption)
                         .AsReadOnly();

            _columnPathElementCache.Add(pathElementId, column);
            return(column);
        }
Esempio n. 10
0
 private void configureImagePathElement(Expression <Func <T, PathElement> > parameterPathExpression, PathElementId pathElementId, string caption)
 {
     configurePathElement(parameterPathExpression, pathElementId, caption)
     .WithRepository(dto => configureContainerRepository(dto, parameterPathExpression.Compile()));
 }
 public void GroupBy(PathElementId pathElementId, int groupIndex = 0)
 {
     groupByColumn(_pathElementsBinder.ColumnAt(pathElementId), groupIndex);
 }
Esempio n. 12
0
        protected void AddToList(List <string> displayList, PathElements pathElements, PathElementId pathElementId)
        {
            var displayName = pathElements[pathElementId].DisplayName;

            if (string.IsNullOrEmpty(displayName))
            {
                return;
            }

            displayList.Add(displayName);
        }
Esempio n. 13
0
 public void SetCaption(PathElementId pathElementId, string caption)
 {
     View.SetCaption(pathElementId, caption);
 }
Esempio n. 14
0
 public void Hide(PathElementId pathElementId)
 {
     View.SetVisibility(pathElementId, visible: false);
 }
Esempio n. 15
0
 public void Show(PathElementId pathElementId)
 {
     View.SetVisibility(pathElementId, visible: true);
 }
Esempio n. 16
0
 public void SetCaption(PathElementId pathElementId, string caption)
 {
     _pathElementsBinder.SetCaption(pathElementId, caption);
 }
Esempio n. 17
0
 private GridColumn xtraColumnBy(PathElementId pathElementId)
 {
     return(_pathElementsBinder.ColumnAt(pathElementId).XtraColumn);
 }
Esempio n. 18
0
 public void SetCaption(PathElementId pathElementId, string caption)
 {
     ColumnAt(pathElementId).Caption = caption;
 }
        private PathElement pathElementAt(PathElements pathElements, PathElementId pathElementId)
        {
            var dto = pathElements[pathElementId];

            return(string.IsNullOrEmpty(dto.DisplayName) ? null : dto);
        }
Esempio n. 20
0
 public IGridViewColumn ColumnAt(PathElementId pathElementId)
 {
     return(_columnPathElementCache[pathElementId]);
 }
 public void GroupBy(PathElementId pathElementId)
 {
     _allQuantityListPresenter.GroupBy(pathElementId);
     _selectedQuantityListPresenter.GroupBy(pathElementId);
 }
 private void updateColumnVisibility(PathElementId pathElement)
 {
     SetVisibility(pathElement, !_parameterDTOs.HasOnlyEmptyValuesAt(pathElement));
 }
 public void Show(PathElementId pathElementId)
 {
     _allQuantityListPresenter.Show(pathElementId);
     _selectedQuantityListPresenter.Show(pathElementId);
 }
 public void SetVisibility(PathElementId pathElement, bool isVisible)
 {
     View.SetVisibility(pathElement, isVisible);
 }
 public void SetCaption(PathElementId pathElementId, string caption)
 {
     _allQuantityListPresenter.SetCaption(pathElementId, caption);
     _selectedQuantityListPresenter.SetCaption(pathElementId, caption);
 }
 public void SetVisibility(PathElementId pathElement, bool isVisible)
 {
     _pathBinder.SetVisibility(pathElement, isVisible);
 }
 public static bool HasDistinctValuesAt(this IEnumerable <IPathRepresentableDTO> pathRepresentables, PathElementId pathElementId)
 {
     return(pathRepresentables.AllDistinctValuesAt(pathElementId).Count > 1);
 }
Esempio n. 28
0
 private void updateColumnVisibility(PathElementId pathElementId)
 {
     _view.SetVisibility(pathElementId, !_allDiffItemDTO.HasOnlyEmptyValuesAt(pathElementId));
 }
 public static IReadOnlyList <string> AllDistinctValuesAt(this IEnumerable <IPathRepresentableDTO> pathRepresentables, PathElementId pathElementId)
 {
     return(pathRepresentables.AllDistinctValues(p => p.PathElements[pathElementId].DisplayName));
 }
Esempio n. 30
0
 public void GroupBy(PathElementId pathElementId)
 {
     View.GroupPathElementId = pathElementId;
 }