private float GetExpandDifference(int index) { PageViewItemSizeInfo viewItemSizeInfo = this.layoutInfo.items[index]; float num = viewItemSizeInfo.layoutLength - viewItemSizeInfo.currentLength; viewItemSizeInfo.SetLayoutSize(viewItemSizeInfo.currentSize); return(num); }
private void ExpandItem(PageViewItemSizeInfo item, int expand) { SizeF newSize = !this.layoutInfo.vertical ? new SizeF(item.currentSize.Width + (float)expand, item.layoutSize.Height) : new SizeF(item.layoutSize.Width, item.currentSize.Height + (float)expand); item.SetCurrentSize(newSize); item.SetLayoutSize(newSize); this.shrinkInfo.shrinkAmount -= (float)expand; }
private void CollapseItem(PageViewItemSizeInfo item, int collapse) { int num = Math.Min((int)Math.Max(0.0f, item.layoutLength - item.minLength), collapse); SizeF newSize = !this.layoutInfo.vertical ? new SizeF(item.layoutSize.Width - (float)num, item.layoutSize.Height) : new SizeF(item.layoutSize.Width, item.layoutSize.Height - (float)num); item.SetLayoutSize(newSize); this.shrinkInfo.shrinkAmount -= (float)collapse; }
private float GetExpandDifference(int index) { PageViewItemSizeInfo item = this.layoutInfo.items[index]; float differ = item.layoutLength - item.currentLength; Debug.Assert(differ >= 0, "Invalid expand algorithm"); item.SetLayoutSize(item.currentSize); return(differ); }
private void ExpandItem(PageViewItemSizeInfo item, int expand) { SizeF expandSize; if (this.layoutInfo.vertical) { expandSize = new SizeF(item.layoutSize.Width, item.currentSize.Height + expand); } else { expandSize = new SizeF(item.currentSize.Width + expand, item.layoutSize.Height); } item.SetCurrentSize(expandSize); item.SetLayoutSize(expandSize); this.shrinkInfo.shrinkAmount -= expand; }
private void CollapseItem(PageViewItemSizeInfo item, int collapse) { float layoutLength = item.layoutLength; float minLength = item.minLength; int maxCollapse = (int)Math.Max(0, layoutLength - minLength); maxCollapse = Math.Min(maxCollapse, collapse); SizeF forcedSize; if (this.layoutInfo.vertical) { forcedSize = new SizeF(item.layoutSize.Width, item.layoutSize.Height - maxCollapse); } else { forcedSize = new SizeF(item.layoutSize.Width - maxCollapse, item.layoutSize.Height); } item.SetLayoutSize(forcedSize); this.shrinkInfo.shrinkAmount -= collapse; }