Skip to content

Instantly share code, notes, and snippets.

View christopherhouse's full-sized avatar
😀

Christopher House christopherhouse

😀
  • Microsoft
  • St. Paul, MN
View GitHub Profile
using System;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ThirteenDaysAWeek.TypeLoadFromString.Tests
{
[TestClass]
public class TypeLoadTests
{
[TestMethod]
namespace ThirteenDaysAWeek.TypeLoadFromString
{
public interface IDomainModel
{
}
public class Domain<T>
where T : IDomainModel
{
public T Model { get; set; }
public Type GetTypeFromString()
{
string typeName = "ThirteenDaysAWeek.TypeLoadFromString.Domain`1[[ThirteenDaysAWeek.TypeLoadFromString.CustomerModel, ThirteenDaysAWeek.TypeLoadFromString, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]";
Type theType = Type.GetType(typeName);
return theType;
}
<system.web>
<httpRuntime maxQueryStringLength="32768" maxUrlLength="32768" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxUrl="32768" maxQueryString="32768" />
</requestFiltering>
</security>
</system.webServer>
public abstract class BaseHttpModule : IHttpModule
{
public void Init(HttpApplication application)
{
application.BeginRequest += (sender, args) =>
OnBeginRequest(new HttpContextWrapper(((HttpApplication)sender).Context));
}
public virtual void OnBeginRequest(HttpContextBase context)
{
public class MyHttpModule : IHttpModule
{
public void Init(HttpApplication appliction)
{
application.BeginRequest += (sender, eventArgs) => {
HttpContext currentContext = (HttpContext)sender;
// Do cool stuff here, probably with the currentContext var
};
}
public static void Start()
{
DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));
bootstrapper.Initialize(CreateKernel);
}
private void SetupGestureRecognizer()
{
this.MapView.AddGestureRecognizer(new UITapGestureRecognizer(r => {
PointF pointInView = r.LocationInView(this.MapView);
CLLocationCoordinate2D touchCoordinates = this.MapView.ConvertPoint(pointInView, this.MapView);
MKMapPoint mapPoint = MKMapPoint.FromCoordinate(touchCoordinates);
foreach (NSObject overlay in this.MapView.Overlays)
{
if (overlay is MKPolygon)
public class MapDelegate : MKMapViewDelegate
{
public override MonoTouch.MapKit.MKOverlayView GetViewForOverlay (MKMapView mapView, NSObject overlay)
{
MKPolygon polygon = overlay as MKPolygon;
MKPolygonView polygonView = new MKPolygonView(polygon);
polygonView.FillColor = UIColor.Purple;
return polygonView;
}