public TLEPanelCell GetCell(ITLEPanelCellElement referenceElement) { if (referenceElement == null) { return(null); } return(PanelCells.FirstOrDefault(f => f.ReferenceElement == referenceElement)); }
public TLEPanelCell GetCell(string graphicName) { if (string.IsNullOrEmpty(graphicName)) { return(null); } return(PanelCells.FirstOrDefault(f => f.GraphicName == graphicName)); }
public void MovePanelCellTime(string graphicName, TimeSpan destenationTime) { var cells = PanelCells.Where(w => w.GraphicName == graphicName); foreach (var cell in cells) { cell.ReferenceElement.SetStartTime(destenationTime); } }
public ITLEPanelCellElement GetCellElementBasedOnGraphicName(string graphicName) { if (string.IsNullOrEmpty(graphicName)) { return(null); } TLEPanelCell cell = PanelCells.Where(w => w.GraphicName == graphicName).FirstOrDefault(); if (cell != null) { return(cell.ReferenceElement); } return(null); }
public void InitializeStackedElements() { StackedElements = new Dictionary <TimeSpan, List <TLEPanelCell> >(); TimeSpan currentTimeSpan = new TimeSpan(StartTime.Ticks); currentTimeSpan = currentTimeSpan.Add(TimeCellWidth); List <TLEPanelCell> group = new List <TLEPanelCell>(); var orderedPanelCells = PanelCells.OrderBy(o => o.ReferenceElement.GetStartTime()).ToList(); //bool first = true; for (int i = 0; i < orderedPanelCells.Count; i++) { if (orderedPanelCells[i].ReferenceElement.GetStartTime() < currentTimeSpan) { group.Add(orderedPanelCells[i]); } else { StackedElements.Add(currentTimeSpan - TimeCellWidth, group); group = new List <TLEPanelCell>(); if (currentTimeSpan > EndTime) { break;//fuse } currentTimeSpan = currentTimeSpan.Add(TimeCellWidth); i--; continue; } } if (group != null && group.Count > 0) { StackedElements.Add(currentTimeSpan - TimeCellWidth, group); } }
public int RemovePanelCell(string graphicName) { return(PanelCells.RemoveAll(w => w.GraphicName == graphicName)); }
//public void MovePanelCellTime(string graphicName, float precentage) //{ // var timespan = new TimeSpan((long)((EndTime.Ticks - StartTime.Ticks) * precentage)); // MovePanelCellTime(graphicName, StartTime + timespan); //} public void RemovePanelCell(TLEPanelCell panelCell) { PanelCells.Remove(panelCell); }