コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PixelScrollAxis"/> class.
 /// </summary>
 /// <param name="sb">The scrollbar state.</param>
 /// <param name="scrollLinesHost">The scroll lines host.</param>
 /// <param name="distancesHost">The distances host.</param>
 public PixelScrollAxis(IScrollBar sb, ILineSizeHost scrollLinesHost, IDistancesHost distancesHost)
     : base(sb, scrollLinesHost)
 {
     if (distancesHost != null)
     {
         this.distancesHost = distancesHost;
     }
     else if (scrollLinesHost != null)
     {
         this.distances = new DistanceRangeCounterCollection
         {
             DefaultDistance = scrollLinesHost.GetDefaultLineSize()
         };
         scrollLinesHost.InitializeScrollAxis(this);
     }
     if (Distances == null)
     {
         throw new ArgumentNullException("Distances");
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PixelScrollAxis"/> class which
 /// is nested as a single line in a parent scroll axis.
 /// </summary>
 /// <param name="parentScrollAxis">The parent scroll axis.</param>
 /// <param name="sb">The scrollbar state.</param>
 /// <param name="scrollLinesHost">The scroll lines host.</param>
 /// <param name="distancesHost">The distances host.</param>
 public PixelScrollAxis(ScrollAxisBase parentScrollAxis, IScrollBar sb, ILineSizeHost scrollLinesHost, IDistancesHost distancesHost)
     : base(sb, scrollLinesHost)
 {
     // GridCellGridRenderer passes in Distances. LineSizeCollection holds them.
     // This allows faster construction of grids when they were scrolled out of view
     // and unloaded.
     this.parentScrollAxis = parentScrollAxis;
     this.distancesHost    = distancesHost;
     if (Distances == null)
     {
         throw new ArgumentNullException("Distances");
     }
 }