Esempio n. 1
0
        protected void ShowFount(int _start, int _count)
        {
            List <MRATextItemView> _vits = new List <MRATextItemView>();

            for (int i = 0; i < _count; i++)
            {
                if (vcount <= 0)
                {
                    break;
                }
                MRATextItemView item = null;
                if (vcount < vits.Count())
                {
                    item = vits.LastOrDefault();
                    vits.RemoveAt(vits.Count() - 1);
                }
                else
                {
                    item = new MRATextItemView();
                    Children.Add(item);
                }
                item.DataContext = lits[_start + i];
                vheight         += item.Height;
                _vits.Add(item);
                while (vcount > 0 && vheight - vits[vcount - 1].Height >= ViewportPixelHeight)
                {
                    vheight -= vits[vcount - 1].Height;
                    vits[vcount-- - 1].DataContext = null;
                }
            }
            vstart  = _start;
            vcount += _vits.Count();
            vits.InsertRange(0, _vits);
        }
 public MRASelectionDrawingVisual(MRATextItemView _parent) : base(_parent)
 {
     this.timerblink = new DispatcherTimer(new TimeSpan(0, 0, 0, 0, 500), DispatcherPriority.Normal, _HandleBlink, Dispatcher);
     this.status     = SelectionStatus.None;
     this.blinkshow  = true;
     this.forceshow  = false;
 }
Esempio n. 3
0
        protected void ShowBack(int _start, int _count)
        {
            int oldvcount = vcount;
            int rcount    = 0;
            int reused    = 0;

            for (int i = _count - 1; i >= 0; i--)
            {
                if (rcount >= vcount)
                {
                    break;
                }
                MRATextItemView item = null;
                if (vcount >= vits.Count())
                {
                    if (reused < rcount)
                    {
                        item = vits[reused++];
                    }
                    else
                    {
                        item = new MRATextItemView();
                        Children.Add(item);
                    }
                    vits.Add(item);
                }
                else
                {
                    item = vits[vcount];
                }
                item.DataContext = lits[_start + i];
                vheight         += item.Height;
                vcount++;
                while (rcount < vcount && vheight - vits[rcount].Height >= ViewportPixelHeight)
                {
                    vheight -= vits[rcount].Height;
                    vits[rcount++].DataContext = null;
                }
            }
            for (int i = reused; i < rcount; i++)
            {
                vits.Add(vits[i]);
            }
            vits.Reverse(oldvcount, vcount - oldvcount);
            vits.RemoveRange(0, rcount);
            vcount -= rcount;
            vstart  = _start + _count - vcount;
        }
Esempio n. 4
0
 protected void ShowBack()
 {
     while (vstart + vcount < lits.Count() && vheight < ViewportPixelHeight)
     {
         while (vits.Count() <= vcount)
         {
             MRATextItemView item = new MRATextItemView();
             Children.Add(item);
             vits.Add(item);
         }
         {
             MRATextItemView item = vits[vcount];
             item.DataContext = lits[vstart + vcount++];
             vheight         += item.Height;
         }
     }
 }
Esempio n. 5
0
        /*
         * protected void HideFount(int _count)
         * {
         *  List<MRATextItemView> _vits = vits.GetRange(0, _count);
         *  _vits.RemoveRange(0, _count);
         *  vstart += _count;
         *  vcount -= _count;
         *  vheight -= _vits.Sum(v => v.Height);
         *  foreach (MRATextItemView item in _vits)
         *      item.DataContext = null;
         *  vits.AddRange(_vits);
         *  ShowBack();
         * }
         *
         * protected void HideBack(int _count)
         * {
         *  for (int i = vcount - _count; i < vcount; i++)
         *  {
         *      vheight -= vits[i].Height;
         *      vits[i].DataContext = null;
         *  }
         *  vcount -= _count;
         *  ShowFount();
         * }
         */
        protected void ShowFount()
        {
            List <MRATextItemView> _vits = new List <MRATextItemView>();

            while (vstart > 0 && vheight < ViewportPixelHeight)
            {
                MRATextItemView item = null;
                if (vits.Count() > vcount)
                {
                    item = vits.LastOrDefault();
                    vits.RemoveAt(vits.Count() - 1);
                }
                else
                {
                    item = new MRATextItemView();
                    Children.Add(item);
                }
                item.DataContext = lits[--vstart];
                vcount++;
                vheight += item.Height;
                _vits.Add(item);
            }
            vits.InsertRange(0, _vits);
        }
Esempio n. 6
0
 public MRANumberBarDrawingVisual(MRATextItemView _parent) : base(_parent)
 {
 }
Esempio n. 7
0
 public MRATextItemDrawingVisual(MRATextItemView _parent)
 {
     this.parent = _parent;
 }
 public MRARawTextDrawingVisual(MRATextItemView _parent) : base(_parent)
 {
 }
 public MRAStructBarDrawingVisual(MRATextItemView _parent) : base(_parent)
 {
 }