/// <summary> /// Gets the last instance of an Object /// </summary> /// <returns>Java.Lang.Object</returns> /// <param name="text">ISpanned</param> /// <param name="kind">Class</param> static Java.Lang.Object GetLast(ISpanned text, Class kind) { var length = text.Length(); var spans = text.GetSpans(0, length, kind); return(spans.Length > 0 ? spans.Last() : null); }
/// <summary> /// Gets the last instance of a given Spanned Object /// </summary> /// <returns>The instance of a Spanned Object</returns> /// <param name="text">The text contained within the span</param> /// <param name="kind">Object type</param> static Java.Lang.Object getLast(ISpanned text, Java.Lang.Class kind) { /* * This knows that the last returned object from getSpans() * will be the most recently added. */ Java.Lang.Object [] objs = text.GetSpans(0, text.Length(), kind); if (objs.Length == 0) { return(null); } else { return(objs [objs.Length - 1]); } }