/// <summary> /// Returns a list of media with the specified ID that /// have encountered an error. </summary> /// <param name="id"> the identifier of the images to check </param> /// <returns> an array of media objects tracked by this media /// tracker with the specified identifier /// that have encountered an error, or /// <code>null</code> if there are none with errors </returns> /// <seealso cref= java.awt.MediaTracker#isErrorID </seealso> /// <seealso cref= java.awt.MediaTracker#isErrorAny </seealso> /// <seealso cref= java.awt.MediaTracker#getErrorsAny </seealso> public virtual Object[] GetErrorsID(int id) { lock (this) { MediaEntry cur = Head; int numerrors = 0; while (cur != null) { if (cur.ID == id && (cur.GetStatus(false, true) & ERRORED) != 0) { numerrors++; } cur = cur.Next; } if (numerrors == 0) { return(null); } Object[] errors = new Object[numerrors]; cur = Head; numerrors = 0; while (cur != null) { if (cur.ID == id && (cur.GetStatus(false, false) & ERRORED) != 0) { errors[numerrors++] = cur.Media; } cur = cur.Next; } return(errors); } }
private int StatusAll(bool load, bool verify) { lock (this) { MediaEntry cur = Head; int status = 0; while (cur != null) { status = status | cur.GetStatus(load, verify); cur = cur.Next; } return(status); } }
/// <summary> /// Checks the error status of all of the images tracked by this /// media tracker with the specified identifier. </summary> /// <param name="id"> the identifier of the images to check </param> /// <returns> <code>true</code> if any of the images with the /// specified identifier had an error during /// loading; <code>false</code> otherwise </returns> /// <seealso cref= java.awt.MediaTracker#isErrorAny </seealso> /// <seealso cref= java.awt.MediaTracker#getErrorsID </seealso> public virtual bool IsErrorID(int id) { lock (this) { MediaEntry cur = Head; while (cur != null) { if (cur.ID == id && (cur.GetStatus(false, true) & ERRORED) != 0) { return(true); } cur = cur.Next; } return(false); } }
private bool CheckID(int id, bool load, bool verify) { lock (this) { MediaEntry cur = Head; bool done = true; while (cur != null) { if (cur.ID == id && (cur.GetStatus(load, verify) & DONE) == 0) { done = false; } cur = cur.Next; } return(done); } }