Example #1
0
        public TLEPanelCell GetCell(ITLEPanelCellElement referenceElement)
        {
            if (referenceElement == null)
            {
                return(null);
            }

            return(PanelCells.FirstOrDefault(f => f.ReferenceElement == referenceElement));
        }
Example #2
0
        public TLEPanelCell GetCell(string graphicName)
        {
            if (string.IsNullOrEmpty(graphicName))
            {
                return(null);
            }

            return(PanelCells.FirstOrDefault(f => f.GraphicName == graphicName));
        }
Example #3
0
        public void MovePanelCellTime(string graphicName, TimeSpan destenationTime)
        {
            var cells = PanelCells.Where(w => w.GraphicName == graphicName);

            foreach (var cell in cells)
            {
                cell.ReferenceElement.SetStartTime(destenationTime);
            }
        }
Example #4
0
        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);
        }
Example #5
0
        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);
            }
        }
Example #6
0
 public int RemovePanelCell(string graphicName)
 {
     return(PanelCells.RemoveAll(w => w.GraphicName == graphicName));
 }
Example #7
0
        //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);
        }