//Code sanitized to protect the foolish.usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Reflection;usingSystem.Web.UI;namespaceMobile.Web.Control{/// <summary>/// Class used to work around Richard being a fucking idiot/// </summary>/// <remarks>/// The point of this is to work around his poor design so that paging will /// work on a mobile control. The main problem is the BindCompany() method, /// which he hoped would be able to do everything. I hope he dies./// </remarks>publicabstractclassRichardIsAFuckingIdiotControl:MobileBaseControl,ICompanyProfileControl{protectedabstractPagerPager{get;}publicvoidBindCompany(intcompanyId){}publicRichardIsAFuckingIdiotControl(){MakeSureNobodyAccidentallyGetsBittenByRichardsStupidity();}privatevoidMakeSureNobodyAccidentallyGetsBittenByRichardsStupidity(){// Make sure nobody is actually using that fucking bindcompany methodMethodInfom=this.GetType().GetMethod("BindCompany",BindingFlags.DeclaredOnly|BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic);if(m!=null){thrownewRichardIsAFuckingIdiotException("No!! Don't use the fucking BindCompany method!!!");}// P.S. this method is a joke ... the rest of the class is fucking serious}/// <summary>/// This returns true if this control is supposed to be doing anything/// at all for this request. Richard thought it was a good idea to load/// the entire website during every request and have things turn themselves/// off. He also thought bandanas and aviator sunglasses were "fuckin' /// gnarly, dude."/// </summary>protectedboolIsThisTheRightPageImNotSureBecauseRichardIsDumb(){returnRequest.QueryString["Section"]==this.MenuItemKey;}protectedoverridevoidOnLoad(EventArgse){if(IsThisTheRightPageImNotSureBecauseRichardIsDumb()){Page.LoadComplete+=newEventHandler(Page_LoadComplete);Pager.RowCount=GetRowCountBecauseRichardIsDumb();}base.OnLoad(e);}protectedabstractintGetRowCountBecauseRichardIsDumb();protectedabstractvoidBindDataBecauseRichardIsDumb();voidPage_LoadComplete(objectsender,EventArgse){BindDataBecauseRichardIsDumb();}// the rest of his reduh-ndant interface memberspublicabstractstringMenuItemName{get;set;}publicabstractstringMenuItemKey{get;set;}publicabstractboolIsCapable(CapabilityCheckchecker,intcompanyId);publicabstractboolShowInMenu{get;}publicvirtualControlCreateHeaderControl(){returnnull;}}}Comments(0)Whatwouldyouliketosay?Flagnotifications
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.