private ReorderListBox.RearrangeItemInfo[] BuildRearrangeMap(int viewFirstIndex, int viewLastIndex) { ReorderListBox.RearrangeItemInfo[] rearrangeItemInfoArray = new ReorderListBox.RearrangeItemInfo[((PresentationFrameworkCollection <object>)((ItemsControl)this).Items).Count]; for (int index = 0; index < rearrangeItemInfoArray.Length; ++index) { object obj = ((PresentationFrameworkCollection <object>)((ItemsControl)this).Items)[index]; ReorderListBox.RearrangeItemInfo rearrangeItemInfo1 = new ReorderListBox.RearrangeItemInfo() { Item = obj, FromIndex = index }; if (viewFirstIndex <= index && index <= viewLastIndex) { ReorderListBoxItem reorderListBoxItem = (ReorderListBoxItem)((ItemsControl)this).ItemContainerGenerator.ContainerFromIndex(index); if (reorderListBoxItem != null) { Point point = ((UIElement)reorderListBoxItem).TransformToVisual((UIElement)this.rearrangeCanvas).Transform(new Point(0.0, 0.0)); // ISSUE: explicit reference operation rearrangeItemInfo1.FromY = ((Point)@point).Y; ReorderListBox.RearrangeItemInfo rearrangeItemInfo2 = rearrangeItemInfo1; Size renderSize = ((UIElement)reorderListBoxItem).RenderSize; // ISSUE: explicit reference operation double height = ((Size)@renderSize).Height; rearrangeItemInfo2.Height = height; } } rearrangeItemInfoArray[index] = rearrangeItemInfo1; } return(rearrangeItemInfoArray); }
private ReorderListBox.RearrangeItemInfo[] BuildRearrangeMap(int viewFirstIndex, int viewLastIndex) { ReorderListBox.RearrangeItemInfo[] rearrangeItemInfoArray = new ReorderListBox.RearrangeItemInfo[this.Items.Count]; for (int index = 0; index < rearrangeItemInfoArray.Length; ++index) { object obj = this.Items[index]; ReorderListBox.RearrangeItemInfo rearrangeItemInfo = new ReorderListBox.RearrangeItemInfo() { Item = obj, FromIndex = index }; if (viewFirstIndex <= index && index <= viewLastIndex) { ReorderListBoxItem reorderListBoxItem = (ReorderListBoxItem)this.ItemContainerGenerator.ContainerFromIndex(index); if (reorderListBoxItem != null) { Point point = reorderListBoxItem.TransformToVisual((UIElement)this.rearrangeCanvas).Transform(new Point(0.0, 0.0)); rearrangeItemInfo.FromY = point.Y; rearrangeItemInfo.Height = reorderListBoxItem.RenderSize.Height; } } rearrangeItemInfoArray[index] = rearrangeItemInfo; } return(rearrangeItemInfoArray); }
private ReorderListBox.RearrangeItemInfo[] BuildRearrangeMap2(ReorderListBox.RearrangeItemInfo[] map, int viewFirstIndex, int viewLastIndex) { ReorderListBox.RearrangeItemInfo[] rearrangeItemInfoArray = new ReorderListBox.RearrangeItemInfo[this.Items.Count]; for (int index = 0; index < rearrangeItemInfoArray.Length; ++index) { object item = this.Items[index]; ReorderListBox.RearrangeItemInfo rearrangeItemInfo = ((IEnumerable <ReorderListBox.RearrangeItemInfo>)map).FirstOrDefault <ReorderListBox.RearrangeItemInfo>((Func <ReorderListBox.RearrangeItemInfo, bool>)(rii => { if (rii.ToIndex < 0) { return(rii.Item == item); } return(false); })); if (rearrangeItemInfo == null) { rearrangeItemInfo = new ReorderListBox.RearrangeItemInfo() { Item = item } } ; rearrangeItemInfo.ToIndex = index; if (viewFirstIndex <= index && index <= viewLastIndex) { ReorderListBoxItem reorderListBoxItem = (ReorderListBoxItem)this.ItemContainerGenerator.ContainerFromIndex(index); if (reorderListBoxItem != null) { Point point = reorderListBoxItem.TransformToVisual((UIElement)this.rearrangeCanvas).Transform(new Point(0.0, 0.0)); rearrangeItemInfo.ToY = point.Y; rearrangeItemInfo.Height = reorderListBoxItem.RenderSize.Height; } } rearrangeItemInfoArray[index] = rearrangeItemInfo; } return(rearrangeItemInfoArray); }