tag:blogger.com,1999:blog-5993074704535120230.post5915183392825914575..comments2014-01-03T17:22:31.355-08:00Comments on Random bits of foo: Walk Of Shame.Erinhttp://www.blogger.com/profile/02595867288580221282noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5993074704535120230.post-90274620612057320582009-09-01T11:45:35.500-07:002009-09-01T11:45:35.500-07:00He he. You know where that code came from right, ...He he. You know where that code came from right, and who wrote the first version of it.Erinhttps://www.blogger.com/profile/02595867288580221282noreply@blogger.comtag:blogger.com,1999:blog-5993074704535120230.post-12772905132751822112009-09-01T09:32:37.408-07:002009-09-01T09:32:37.408-07:00Actually, why remove it by index when you can just...Actually, why remove it by index when you can just remove it by object, like so:<br /><br />this._AviableCabinets.Remove(this._AviableCabinets.Find(c => c.Name == LanguageDB.GetText("SelectDestLocalAllCabinetsText")));<br /><br />The Remove() doesn't have any problems if you pass it null, which is what the Find function will return if the object wasn't found.<br /><br />Much simpler and probably quicker than using indexes. Assuming '_AviableCabinets' is a List<T> that is.Melhttp://mel-green.comnoreply@blogger.com