private void UpdateUI(IndexBufferPtrController indexBufferPtrController) { if (indexBufferPtrController is ZeroIndexBufferPtrController) { this.lblFirst.Text = "First Vertex:"; this.lblCount.Text = "Vertex Count:"; this.trackFirst.Minimum = indexBufferPtrController.First(); this.trackFirst.Maximum = indexBufferPtrController.Count(); this.trackFirst.Value = indexBufferPtrController.First(); this.trackCount.Minimum = indexBufferPtrController.First(); this.trackCount.Maximum = indexBufferPtrController.Count(); this.trackCount.Value = indexBufferPtrController.Count(); this.lblFirstValue.Text = this.trackFirst.Value.ToString(); this.lblCountValue.Text = this.trackCount.Value.ToString(); this.Text = string.Format("{0}", this.controller); } else if (indexBufferPtrController is OneIndexBufferPtrController) { this.lblFirst.Text = "First Index:"; this.lblCount.Text = "Element Count:"; this.trackFirst.Minimum = indexBufferPtrController.First(); this.trackFirst.Maximum = indexBufferPtrController.Count(); this.trackFirst.Value = indexBufferPtrController.First(); this.trackCount.Minimum = indexBufferPtrController.First(); this.trackCount.Maximum = indexBufferPtrController.Count(); this.trackCount.Value = indexBufferPtrController.Count(); this.lblFirstValue.Text = this.trackFirst.Value.ToString(); this.lblCountValue.Text = this.trackCount.Value.ToString(); } else { throw new NotImplementedException(); } }
public void SetTarget(IndexBufferPtr indexBufferPtr) { if (indexBufferPtr == null) { throw new ArgumentNullException(); } this.controller = indexBufferPtr.CreateController(); UpdateUI(this.controller); this.Text = string.Format("{0}", this.controller); }