public void Add(SizeColorText tempSizeColorText) { int width = tempSizeColorText.mSize.Width; int height = tempSizeColorText.mSize.Height; if (width == height) { SortedList_Square.Add(width * height + myRand.Next(1000) * 0.00001, tempSizeColorText); } else { SortedList_Rectangle.Add(width * height + myRand.Next(1000) * 0.00001, tempSizeColorText); } }
public SizeColorText[] allRectanles_Squares(string strRectangleSquare) { SizeColorText[] returnArrSizeColorText = null; if (strRectangleSquare == "Rectangle") { returnArrSizeColorText = new SizeColorText[SortedList_Rectangle.Count]; for (int i = 0; i < SortedList_Rectangle.Count; i++) { returnArrSizeColorText[i] = (SizeColorText)(SortedList_Rectangle.GetByIndex(i)); } return(returnArrSizeColorText); } returnArrSizeColorText = new SizeColorText[SortedList_Square.Count]; for (int i = 0; i < SortedList_Square.Count; i++) { returnArrSizeColorText[i] = (SizeColorText)(SortedList_Square.GetByIndex(i)); } return(returnArrSizeColorText); }